Vue番外篇-路由进阶(一)

Vue的router默认是

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld
    }
  ]
})
 
有的时候我们为了实现更多的功能,需要在router中加入更多的参数来满足后续的操作
meta: {
  title:'HelloWork',    标题
  parent: 'home',     上一层页面
  index : 'index',            页面标签
  icon: '',                        图标
  rank: 1,                       排序
  needRoles: 1,             是否需要权限才能访问
},
 
我们可以设定一个meta或者其他自定的参数来存放这些内容,里面的参数我们可以按照自己的需求来设定
 
往往我们在这个页面下面还会有其他的子页面,可以通过
children:[]
把子页面的内容放在这个参数里面。。。
 
 
posted @ 2019-09-01 12:26  JeckyHuang  阅读(191)  评论(0编辑  收藏  举报