若依框架的话,直接打开src/api/router/index.js路由配置项
{
path: '/storage',
component: Layout,
hidden: true,
redirect: 'noredirect',
children: [
{
path: '/order',
component: () => import('@/views/storage/order'),
name: 'material',
meta: { title: '入库计划单', icon: 'user' }
},
{
path: '/inventory',
component: () => import('@/views/storage/inventory'),
name: 'inventory',
meta: { title: '收货清点', noCache: true,icon: 'user' }
},
// noCache: true true就可以每次跳转都刷新缓存了,默认是false.
]
},
a页面——》跳进吧页面 下面附带路由跳转传值
a页面
pathInventory(row){
this.$router.push({ // 核心语句
name: 'inventory',
params: {
id: row.id
}
})
},
b页面
created() {
console.log(this.$route.params.id)
}, // vue实例初始化完成会执行