SoFunction
Updated on 2025-04-09

vue routing meta Example code for setting navigation hidden and display functions

vue routing meta sets the title navigation hidden, the specific code is as follows:

routes: [{
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld,
      meta: {
        title: "HelloWorld",  It's realistictitle
        show: true        Set navigation to hide display
      }

    }]

<template>
  <div >
    <router-view></router-view>
    <bottom v-show="this.$"></bottom>  this.$ Show or hide
  </div> 
</template>

((to, from, next) => {
 
  if () {
     = 
  }
  next()
})<br><br>Listen to routes Write title

PS: Routing meta in vue

meta field (metadata)

When configuring the route, add a custom meta object to each route. You can set some states in the meta object to perform some operations. It's perfect for login verification

{
 path: '/actile',
 name: 'Actile',
 component: Actile,
 meta: {
  login_require: false
 },
},
{
 path: '/goodslist',
 name: 'goodslist',
 component: Goodslist,
 meta: {
  login_require: true
 },
 children:[
  {
   path: 'online',
   component: GoodslistOnline
  }
 ]
}

Here we only need to determine whether login_require in the meta object below the item is true, and we can make some restrictions.

((to, from, next) => {
 if ((function (item) {
  return .login_require
 })) {
  next('/login')
 } else 
  next()
})

Summarize

This is the article about the example code of vue routing meta setting navigation hidden and display functions. For more related vue routing meta setting navigation hidden and display content, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!