编写二级路由
外卖网站
这里配置二级路由
import Vue from ‘vue’
import Router from ‘vue-router’
import Head from ‘@/components/Head-t’
import Bxiao from ‘@/components/Bxiao’
import Fu from ‘@/components/Fu’
import Eshi from ‘@/components/Eshi’
import Yshi from ‘@/components/Yshi’
Vue.use(Router)
export default new Router({
routes: [
{
path: ‘/’,
redirect: ‘/head/fn’
},
{
path: ‘/head’,
name: ‘head’,
component: Head,
children: [
{
path: ‘fn’,
name: ‘fn’,
component: Fu
},
{
path: ‘/bxiao’,
name: ‘bxiao’,
component: Bxiao
},
{
path: ‘/eshi’,
name: ‘eshi’,
component: Eshi
},
{
path: ‘/yshi’,
name: ‘yshi’,
component: Yshi
}
]
},
]
})