若依框架的话,直接打开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实例初始化完成会执行
文章展示了在若依框架中进行路由配置,包括隐藏组件、重定向以及子路由的设置。同时,详细说明了如何在Vue应用中从A页面跳转到B页面并传递参数,以及如何在B页面接收这些参数。此外,还讨论了路由的缓存控制选项。
5983

被折叠的 条评论
为什么被折叠?



