当前位置:网站首页>router---Route guard
router---Route guard
2022-08-04 13:02:00 【monstkl】
One, guard parameters
1, the route that to will enter2. From the route that the current navigation is about to leave3. next means release. It must be strictly ensured that this method is called at least once in use, and it is very easy to cause an infinite loop.The parameter of the next method can be a path string or an objectpath string:routes:[{path: '/test'}]either next('test') or next('/test')Object:next({name: 'detail'})next({path: '/detail'})Common scenarios:Replace the current route as follows---beforeEach (to, from, next) {if (to.name === 'detail') {next()next({...to, replace: true})}}
Second, global guard
Three, route exclusive guard
Four, component guards
V. Navigation analysis process
边栏推荐
猜你喜欢
随机推荐
持续交付(四)Jenkins多线程任务执行
Small program on how to play in the construction of e-government service platform value
Valentine's Day Romantic 3D Photo Wall [with source code]
七夕疯狂搞钱的年轻人,一周赚14万
封装、继承、多态的联合使用实现不同等级学生分数信息的统计
《社会企业开展应聘文职人员培训规范》团体标准在新华书店上架
使用COLMAP初步三维重建
MogDB/openGauss 3.0 扩容及缩容
Systemui qsSetting添加新图标
String是引用类型
他是“中台”之父,凭一个概念为阿里狂赚百亿
Motion Regulations (18) - and check the basic questions - gang
"Lonely Walking on the Moon" is a powerful medicine, it can't cure the internal friction of happy twist
密码设置有关方法:不能相同字母,不能为连续字符
面试官:如何查看/etc目录下包含abc字符串的文件?
Cows 树状数组
1314元的七夕礼盒,收割了多少直男?
【PHP实现微信公众平台开发—基础篇】第2章 微信公众账号及申请流程详解
Matlab记录
双目立体视觉笔记(三)三角测量、极线校正