首先在页面引入router
及
import router from "../../router/index";
然后传值就是
router.push({path:'/addShop',query:{id:id}})
在另一个页面接受到的是
在这里插入代码片{currentRoute: RefImpl, addRoute: ƒ, removeRoute: ƒ, hasRoute: ƒ, getRoutes: ƒ, …}
addRoute: ƒ addRoute(parentOrRoute, route)
afterEach: ƒ add(handler)
back: () => go(-1)
beforeEach: ƒ add(handler)
beforeResolve: ƒ add(handler)
currentRoute: RefImpl
__v_isRef: true
_rawValue:
fullPath: "/addShop?id=10964"
hash: ""
href: "/addShop?id=10964"
matched: (2) [{…}, {…}]
meta: {}
name: "addShop"
params: {}
path: "/addShop"
query: {id: "10964"}
redirectedFrom: undefined
__proto__: Object
_shallow: true
_value: {fullPath: "/addShop?id=10964", path: "/addShop", query: {…}, hash: "", name: "addShop", …}
value: Object
__proto__: Object
forward: () => go(1)
g