vue 二级路由

  作者:chrispy

import Vue from 'vue'import Router from 'vue-router'import login from '@/views/login'import noPange from '@/views/404'import errorPage from '@/views/500'import home from '@/views/home'import s

import Vue from 'vue'

import Router from 'vue-router'

import login from '@/views/login'

import noPange from '@/views/404'

import errorPage from '@/views/500'

import home from '@/views/home'

import shigongdanwei from '@/views/gongyingshang/shigongdanwei'


Vue.use(Router)


export default new Router({

  routes: [

    {

      path: '/',

      name: 'login',

      component: login,

      meta: {

        page: '登录页'

      }

    },

    {

      path: '*',

      name: 'noPange',

      component: noPange,

      meta: {

        page: '404'

      }

    },

    {

      path: '/500',

      name: 'errorPage',

      component: errorPage,

      meta: {

        page: '服务器错误'

      }

    },

    { // 首页

      path: '/home',

      name: 'Home',

      component: home,

      meta: {

        page: '首页'

      },

      children: [

        {

          path: 'shigongdanwei',

          name: 'Shigongdanwei',

          component: shigongdanwei

        }

      ]

    }

  ]

})


有用  |  无用

猜你喜欢