import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    //path为路径
    path: '/home',
    //name是路由名称
    name: 'home',
    //component为引入目录下的XX组件
    component: () => import('../views/home.vue'),
    //children为home页面下的子路由
    children:[
      {
        path:'homepage',
        name:'homepage',
        component: () => import('../views/Homepage/homepage.vue'),
      },
      {
        path:'menu',
        name:'menu',
        component: () => import('../views/Menu/menu.vue'),
      },
      {
        path:'shoppingCart',
        name:'shoppingCart',
        component: () => import('../views/ShoppingCart/shoppingCart.vue'),
      },
      {
        path:'my',
        name:'my',
        component: () => import('../views/My/my.vue'),
      },
    ]
  },
  //路由跳转菜品详情页
  {
    path:'/menuInfo',
    nama:'menuInfo',
    component: () => import('../views/MenuInfo/menuInfo.vue'),
  },
  {
    path:'/leader-mailbox',
    name:'leader-mailbox',
    component:()=>import('../views/XiXianZhongXin/leader-mailbox/leader-mailbox.vue')
  },
  {
    path:'/leader-mailbox-list',
    name:'leader-mailbox-list',
    component:()=>import('../views/XiXianZhongXin/leader-mailbox/leader-mailbox-list.vue')
  },
  //路由重定向
  {
    path:'/',
    redirect:{"name":"leader-mailbox"}
  }
]


const router = new VueRouter({
  routes
})

export default router
