【发布时间】:2020-03-24 06:36:15
【问题描述】:
如何在进入路线之前重定向到特定路线? Vue路由器
这是我的路由器配置,我正在使用“beforeEach”方法,但它无法正常工作。
const routes=[
{
path:'/',
name:'index',
component:index,
beforeEach:((to,from,next)=>{
next('/content')
}),
children:[
{
path:"content",
component:content,
name:'content'
},
{
path:"requestDemand",
component:requestDemand,
name:'requestDemand'
},
{
path:"newReport",
component:newReport,
name:'newReport'
},
{
path:"lastestDemand",
component:lastestDemand,
name:'lastestDemand'
},
],
}
];
【问题讨论】:
标签: vue.js routing vue-router