当前位置:网站首页>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 } })
边栏推荐
- 请问flink支持sqlServer数据库么?获取sqlServer数据库的变化
- Use vscode to configure Mysql to realize connection, query, and other functions
- 论文阅读 (62):Pointer Networks
- 【OpenGL】着色器(Shader)的使用
- Unity sends a post request to the golang server for parsing and returning
- Spingboot integrates the quartz framework to realize dynamic scheduled tasks (support real-time addition, deletion, modification and query tasks)
- Thoroughly understand kubernetes scheduling framework and plug-ins
- 后缀自动机(SAM)讲解 + Luogu p3804【模板】后缀自动机 (SAM)
- Gin service exit
- Excel file reading and writing (creation and parsing)
猜你喜欢
随机推荐
WPF简单登录页面的完成案例
Implementation of book borrowing management system based on C language
【OpenGL】着色器(Shader)的使用
太空射击第17课: Game Over (結束)
解决CSDN因版权不明而无法发布博客的问题
JS break and continue and return keywords
spark学习笔记(七)——sparkcore核心编程-RDD序列化/依赖关系/持久化/分区器/累加器/广播变量
Image noise and matrix inversion
Gin service exit
Custom events
20-40K| 梅卡曼德3D视觉算法/软件/产品经理招聘
Guess the number / / generate a random number for the first time
Homebrew brew update 长时间没反应(或卡在 Updating Homebrew...)
Comparison of advantages between can & canfd integrated test analysis software lkmaster and PCA Explorer 6 analysis software
WPF interface layout must know basis
约瑟夫环问题
[C language brush leetcode] 67. binary sum (E)
Synchronous / asynchronous, blocking / non blocking and IO
【charles日常问题】开启charles,使用不了钉钉
【Unity实战100例】Unity万能答题系统之单选多选判断题全部通用

![[OpenGL] use of shaders](/img/73/1322afec8add6462ca4b82cb8112d1.png)







