路由钩子
1.全局路由钩子beforeEach,afterEach的用法
每次切换路由都会触发全局的钩子函数,写在router.js文件中
router.beforeEach() 进入之前触发
router.afterEach() 进入之后触发
const router = new Router({
routes:[{
path: '/dashboard',
name: 'dashboard',
component: () => import( /* webpackChunkName: "
原创
2020-11-04 09:55:42 ·
370 阅读 ·
3 评论