Vue通信、傳值的幾種方式

一、通過路由帶參數進行傳值 ①兩個組件 A和B,A組件通過query把orderId傳遞給B組件(觸發事件可以是點擊事件、鉤子函數等) this . $router . push ({ path: '/conponentsB' , query: { orderId: 123 } }) // 跳轉到B ②在B組件中獲取A組件傳遞過來的參數 this . $route . query . orderI
相關文章
相關標籤/搜索