1。在main.js引入二級三級路由
//二級路由
import Contact from './components/about/Contact'
//三級路由
import Phone from './components/about/Contact/Phone'
2。配置路由
const routes =[
{path:'/',name:'HomeLink',component:Home},
{path:'/Menu',name:'MenuLink',component:Menu},
{path:'/Admin',name:'AdminLink',component:Admin},
{path:'/About',name:'AboutLink',component:About,children:[
{path:'/Contact',name:'ContactLink',component:Contact,children:[
{path:'/Phone',name:'phoneLink',component:Phone},
{path:'/Name',name:'nameLink',component:Name}
]},
{path:'/Delivery',name:'DeliveryLink',component:Delivery},
{path:'/History',name:'HistoryLink',component:History},
{path:'/OrderGuide',name:'OrderGuideLink',component:OrderGuide}
]},
{path:'/Login',name:'LoginLink',component:Login},
{path:'/Register',name:'RegisterLink',component:Register},
{path:'*',redirect:'/'}
]
3。訪問路由