Skip to content

vue通过路由修改标题,关键字,描述

License

Notifications You must be signed in to change notification settings

vrockn/vue-header

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vue通过路由修改标题,关键字,描述

App.Vue

<template>
  <div id="app">
    <router-view v-header-title="$route.meta.title" v-header-keywords="$route.meta.keyword" 
    v-header-description="$route.meta.description"></router-view>
  </div>
</template>

router

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '*',
      component: NotFoundComponent
    },
    {
      path: '/',
      meta: {
        title: 'home',
        keyword: 'keyword',
        description: 'desc'
      },
      name: 'Index',
      component: Index
    },
    {
      path: '/admin',
      name: 'Login',
      meta: {
        title: 'login'
      },
      component: Login
    },
    {
      path: '/admin/main',
      name: 'Main',
      meta: {
        title: 'admin',
        keyword: 'text'
      },
      component: Main
    }
  ]
})

About

vue通过路由修改标题,关键字,描述

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published