当前位置:网站首页>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作业是以upsert-kafka的方式写入数据的,但是我在mysql里面去更
- H3C_ Using setting default static routing priority to realize the active and standby function of export dual lines
- My personal website doesn't allow access to wechat, so I did this
- JS chicken laying eggs and egg laying chickens. Who appeared earlier, object or function? Is function an instance of function?
- gin 服务退出
- 彻底搞懂kubernetes调度框架与插件
- WPF nested layout case
- MySQL 有这一篇就够(呕心狂敲37k字,只为博君一点赞!!!)
- 以太网接口介绍
- 对Vintage分析的一些学习理解
猜你喜欢

利用C语言巧妙实现棋类游戏——三子棋

spark学习笔记(七)——sparkcore核心编程-RDD序列化/依赖关系/持久化/分区器/累加器/广播变量

2022-07-28: what is the output of the following go language code? A:AA; B:AB; C:BA; D:BB。 package main import ( “fmt“ ) func main() { f

后缀自动机(SAM)讲解 + Luogu p3804【模板】后缀自动机 (SAM)

H3C_利用设置缺省静态路由优先级实现出口双线路的主备功能

外包干了3年,跳槽后转自动化测试工资是原来的2倍,秘诀原来是......

Ethernet interface introduction

JS chicken laying eggs and egg laying chickens. Who appeared earlier, object or function? Is function an instance of function?

win11系统错误:由于找不到 iertutil.dll,无法继续执行代码。重新安装程序可能会解决此问题

Thoroughly understand kubernetes scheduling framework and plug-ins
随机推荐
330. 按要求补齐数组
MySQL uses the client and select methods to view the summary of blob type fields
Image noise and matrix inversion
Remote invocation of microservices
约瑟夫环问题
js中break与continue和return关键字
route的meta配置项
Vmware16 create virtual machine: win11 cannot be installed
Docker最新超详细教程——Docker创建运行MySQL并挂载
接口测试实战项目03:执行测试用例
Student status management system based on C language design
后缀自动机(SAM)讲解 + Luogu p3804【模板】后缀自动机 (SAM)
我的个人网站不让接入微信登录,于是我做了这个
After 4 years of development and 13K, if you want to change to automated testing, can your salary still rise···
Win11vmware turns on the virtual machine and restarts on the blue screen and the solution that cannot be started
[OpenGL] use of shaders
5-整合swagger2
微服务远程调用
Fillder use
Summary of OCR optical character recognition methods