update
This commit is contained in:
@@ -222,16 +222,22 @@ from 当前正要离开的页面信息
|
|||||||
next 进行管道中的下一个钩子
|
next 进行管道中的下一个钩子
|
||||||
如果是 next(false), 中断当前的导航
|
如果是 next(false), 中断当前的导航
|
||||||
|
|
||||||
2.路由独享的 导航守卫,也可以声明
|
2.路由独享的 导航守卫
|
||||||
|
|
||||||
在main.js中的 routes 路由定义:
|
在main.js中的 routes 路由定义:
|
||||||
|
|
||||||
|
```
|
||||||
const routes= [
|
const routes= [
|
||||||
{ path: "/a", component: aa },
|
{ path: "/a", component: aa },
|
||||||
{ path: "/b", component: bb },
|
{ path: "/b", component: bb },
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
把 { path: "/a", component: aa },改成:
|
把 { path: "/a", component: aa },改成:
|
||||||
|
|
||||||
|
```
|
||||||
{
|
{
|
||||||
path: "/b",
|
path: "/b",
|
||||||
component: bb,
|
component: bb,
|
||||||
@@ -239,8 +245,8 @@ const routes= [
|
|||||||
window.console.log("aaassjlfml;")
|
window.console.log("aaassjlfml;")
|
||||||
next()
|
next()
|
||||||
}
|
}
|
||||||
// beforeEnter: (to, from, next) => {
|
|
||||||
// window.console.log("bedo"),
|
|
||||||
// next()
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user