import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const routes = [

  {
    path: '/',
    component: () => import('@/pages/layout/index.vue'),
    children: [
      {
        path: '/',
        redirect: '/home'
      },
      {
        path: '/home',
        name: 'home',
        component: () => import('@/pages/home/home.vue')
      },
      {
        path: '/survey',
        name: 'survey',
        component: () => import('@/pages/survey/survey.vue')
      },
      {
        path: '/survey-type',
        name: 'survey-type',
        component: () => import('@/pages/survey/survey-type.vue')
      },
      {
        path: '/information',
        name: 'information',
        component: () => import('@/pages/information/information.vue')
      },
      {
        path: '/information-type',
        name: 'information-type',
        component: () => import('@/pages/information/information-type.vue')
      },
      {
        path: '/information-detail',
        name: 'information-detail',
        component: () => import('@/pages/information/information-detail.vue')
      },
      {
        path: '/exhibition',
        name: 'exhibition',
        component: () => import('@/pages/exhibition/exhibition.vue')
      },
      {
        path: '/exhibition-type',
        name: 'exhibition-type',
        component: () => import('@/pages/exhibition/exhibition-type.vue')
      },
      {
        path: '/exhibition-detail',
        name: 'exhibition-detail',
        component: () => import('@/pages/exhibition/exhibition-detail.vue')
      },
      {
        path: '/collection',
        name: 'collection',
        component: () => import('@/pages/collection/collection.vue')
      },
      {
        path: '/collection-type',
        name: 'collection-type',
        component: () => import('@/pages/collection/collection-type.vue')
      },
      {
        path: '/collection-detail',
        name: 'collection-detail',
        component: () => import('@/pages/collection/collection-detail.vue')
      },
      {
        path: '/service',
        name: 'service',
        component: () => import('@/pages/service/service.vue')
      },
      {
        path: '/service-detail',
        name: 'service-detail',
        component: () => import('@/pages/service/service-detail.vue')
      },
      {
        path: '/activity',
        name: 'activity',
        component: () => import('@/pages/activity/activity.vue')
      },
      {
        path: '/activity-type',
        name: 'activity-type',
        component: () => import('@/pages/activity/activity-type.vue')
      },
      {
        path: '/activity-detail',
        name: 'activity-detail',
        component: () => import('@/pages/activity/activity-detail.vue')
      }
    ]
  }
]

const router = new Router({
  routes
})

router.beforeEach((to, from, next) => {
  next()
})

export default router
