25.vue中路由的配置

2018-08-13  本文已影响5人  yaoyao妖妖

包含底部导航部分和单页导航

Vue.use(Router)

export default new Router({
  mode: 'history',
  base: '/store-order/',
  routes: [
    {
      path: '/',
      redirect: '/mainpage'
    },
    {
      path: '/mainpage',
      component: MainPage,
      name: 'MainPage',
      redirect: '/mainpage/home',
      children: [
        {
          path: '/mainpage/home',
          // name: 'home-animation',当有子child的时候不需要配置name参数
          component: PageTransition,
          children: [
            {
              path: '/',
              name: 'Home',
              component: Home
            },
            {
              // 添加图片
              path: '/mainpage/home/addPicture',
              component: AddPicture
            },
            {
              // 主数据维护
              path: '/mainpage/home/dataMaintenance',
              component: DataMaintenance
            },
            {
              // 主数据编辑
              path: '/mainpage/home/dataEdit',
              component: DataEdit
            },
            {
              // 商品分类
              path: '/mainpage/home/goodsCategory',
              component: GoodsCategory
            },
            {
              path: '/mainpage/home/myorder',
              component: MyOrder,
              name: 'MyOrder'
            }
          ]
        },
        {path: '/mainpage/cart', name: 'Cart', component: Cart},
        {path: '/mainpage/mine', name: 'Mine', component: Mine}
      ]
    }
  ]
})
上一篇 下一篇

猜你喜欢

热点阅读