当前位置:网站首页>Meta configuration item of route
Meta configuration item of route
2022-07-29 07:20:00 【Two seven twenty seven】
meta It is called routing meta information , It is the information carried in the route , You can customize meta To realize some routing functions
Use scenarios : For example, set the title of the page corresponding to each route 、 And determine whether a page needs permission verification
routes: [ { // Name this route guanyv name: 'guanyv', path: '/about', component: () => import('../views/About.vue') // Customize title Properties and isAuth attribute , Used in route navigation guard , Set the title and permission verification for the page meta: { title: ' About ', isAuth: true} }, ... ]
// Use the global pre routing guard to authenticate the page router.beforeEach((to, form, next) => { // By judging whether authentication is required if (to.meta.isAuth) { if (localStroage.getItem('token') === 'xxxx') { // eligible , Release to the next route next() } else { console.log(' Check failed ') } } }) // Use the global pre routing guard to modify the page title router.afterEach((to, form, next) => { // Judge whether there is title attribute if (form.meta.title) { document.title = to.meta.title // Modify page title } })
边栏推荐
- Latest 10 billion quantitative private placement list
- 时钟树综合(一)
- Summer summary (II)
- 2022-07-28:以下go语言代码输出什么?A:AA;B:AB;C:BA;D:BB。 package main import ( “fmt“ ) func main() { f
- Homebrew brew update 长时间没反应(或卡在 Updating Homebrew...)
- Variables and encryption in ansible
- VMware16创建虚拟机:无法创建新虚拟机,不具备执行此操作的权限
- SQL优化
- 【Redis】Redis开发规范与注意事项
- npm install 时,卡住不动,五种解决方法
猜你喜欢
同步/异步、阻塞/非阻塞 与 IO
后缀自动机(SAM)讲解 + Luogu p3804【模板】后缀自动机 (SAM)
After three years of outsourcing, the salary of automatic testing after job hopping is twice that of the original. The secret is
Leetcode 879. profit plan
VMware16创建虚拟机:无法创建新虚拟机,不具备执行此操作的权限
MySQL - multi table query
利用C语言巧妙实现棋类游戏——三子棋
Remote invocation of microservices
Synchronous / asynchronous, blocking / non blocking and IO
VMware16安装虚拟机遇到的问题
随机推荐
Gin template
Paper reading (62):pointer networks
Flink real-time warehouse DWD layer (processing complex data - installation and replacement of streams and tables) template code
力扣(LeetCode)209. 长度最小的子数组(2022.07.28)
暑期总结(二)
Student status management system based on C language design
Vmware16 create virtual machine: win11 cannot be installed
gin 参数验证
Image noise and matrix inversion
MySQL uses the client and select methods to view the summary of blob type fields
【Redis】Redis开发规范与注意事项
[C language brush leetcode] 1054. Bar code with equal distance (m)
计算程序运行时间 demo
最新百亿量化私募名单
[C language brush leetcode] 2332. The latest time to get on the bus (m)
Vagrant box cluster processing
【Unity实战100例】Unity万能答题系统之单选多选判断题全部通用
pytorch的技巧记录
Problems encountered in vmware16 installing virtual machines
请问flink支持sqlServer数据库么?获取sqlServer数据库的变化