当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
获取本机IP地址的脚本
CReFF缓解长尾数据联邦学习(IJCAI 2022)
Hit the interview!The latest interview booklet of Ali Jin, nine silver and ten is stable!
MySQL-数据类型
技术分享| 小程序实现音视频通话
Valentine's Day Romantic 3D Photo Wall [with source code]
LeetCode_3_无重复字符的最长子串
Why is Luo Zhenyu's A-share dream so difficult to fulfill?
干货丨数学规划视角下的分货优化解题思路
面试官:连 INSERT INTO SET 都不知道怎么用,你这3年都干些什么了?
用VbScript控制光驱
Script to get local IP address
广告电商系统开发之订单处理
代码越写越乱?那是因为你没用责任链!
并发刺客(False Sharing)——并发程序的隐藏杀手
du命令_set命令选项
《会面》-凯瑟琳曼斯菲尔德(徐志摩译)
绩效考核带给员工的不能只是压力
FHQ-Treap 简介
Cache character stream









