当前位置:网站首页>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
边栏推荐
猜你喜欢
备份控制文件
【解决方案 三十一】Navicat数据库结构同步
他是“中台”之父,凭一个概念为阿里狂赚百亿
为什么密码云服务平台是云时代的必然之选?
【牛客刷题-SQL大厂面试真题】NO5.某宝店铺分析(电商模式)
用过Apifox这个API接口工具后,确实感觉postman有点鸡肋......
【黑马早报】尚乘数科上市13天,市值超阿里;北大终止陈春花聘用合同;新东方花近200亿退学费和遣散费;张小泉75%产品贴牌代工...
持续交付(二)PipeLine基本使用
Access Huawei game anti-addiction, click the anti-addiction pop-up window, the game crashes
到底什么是真正的HTAP?
随机推荐
持续交付(四)Jenkins多线程任务执行
高手,云集在于REST、gRPC 和 GraphQL之间!
面试官:说一下NIO和BIO的区别
动规(16)-并查集基础题——亲戚(Relations)
【PHP实现微信公众平台开发—基础篇】第1章 课程介绍
Hit the interview!The latest interview booklet of Ali Jin, nine silver and ten is stable!
新 Nsight Graph、Nsight Aftermath 版本中的性能提升和增强功能
用VbScript控制光驱
情人节浪漫3D照片墙【附源码】
LeetCode_643_子数组的最大平均数Ⅰ
MogDB/openGauss 3.0 扩容及缩容
Just a Hook
LeetCode_3_无重复字符的最长子串
项目里的各种配置,你都了解吗?
Small program on how to play in the construction of e-government service platform value
Js获取当前页面url参数
跨链桥已成行业最大安全隐患 为什么和怎么办
sqlplus报错ORA-12547: TNS:lost contact解决
Haproxy搭建web群集
Arduino框架下I2S控制ADC采样以及PWM输出示例解析