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

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'layout',
    component: () => import('../views/layout/index.vue'),
    redirect: { name: 'home' },
    children: [
      {
        path: 'home',
        name: 'home',
        component: () => import('../views/home/index.vue')
      },
      {
        path: 'tab1',
        name: 'tab1',
        meta: { myInd: 1 },
        component: () => import('../views/tab1/index.vue')
      },
      {
        path: 'tab2',
        name: 'tab2',
        meta: { myInd: 2 },
        component: () => import('../views/tab2/index.vue')
      },
      {
        path: 'tab3',
        name: 'tab3',
        meta: { myInd: 3 },
        component: () => import('../views/tab3/index.vue')
      },
      {
        path: 'tab4',
        name: 'tab4',
        meta: { myInd: 4 },
        component: () => import('../views/tab4/index.vue')
      },
      {
        path: 'tab4-1',
        name: 'tab4-1',
        meta: { myInd: 4 },
        component: () => import('../views/tab4/tab4-1.vue')
      },
      {
        path: 'tab4-2',
        name: 'tab4-2',
        meta: { myInd: 4 },
        component: () => import('../views/tab4/tab4-2.vue')
      },
      {
        path: 'tab4-3',
        name: 'tab4-3',
        meta: { myInd: 4 },
        component: () => import('../views/tab4/tab4-3.vue')
      },
      {
        path: 'tab4-4',
        name: 'tab4-4',
        meta: { myInd: 4 },
        component: () => import('../views/tab4/tab4-4.vue')
      },
      {
        path: 'tab4-4-1',
        name: 'tab4-4-1',
        meta: { myInd: 4 },
        component: () => import('../views/tab4/tab4-4-1.vue')
      },
      {
        path: 'tab4-5',
        name: 'tab4-5',
        meta: { myInd: 4 },
        component: () => import('../views/tab4/tab4-5.vue')
      },
      {
        path: 'tab4-5-1',
        name: 'tab4-5-1',
        meta: { myInd: 4 },
        component: () => import('../views/tab4/tab4-5-1.vue')
      }
    ]
  }
]

const router = new VueRouter({
  // mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
