import Vue from 'vue'
import VueRouter from 'vue-router'
import index from '../views/index.vue';
import about from '../views/About';
import explain from '../views/explain';
import question from '../views/question';
// import member from '../views/member';
Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect:'/index'
  },
  {
    path: '/index',
    name: 'index',
    component: index,
  },
  
  {
    path: '/About',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: about,
    redirect: '/About/contcat',
    children: [
      {
        path: 'contcat',
        name: 'contcat',
        component: () => import('../views/join/contcat.vue')
      }
    ]
  },
  {
    path:'/explain',
    name:'explain',
    redirect: '/explain/int',
    component:explain,
    children: [
      {
        path: 'int',
        name: 'int',
        component: () => import('../views/about/int.vue')
      },
      {
        path: 'arch',
        name: 'arch',
        component: () => import('../views/about/arch.vue')
      },
      {
        path: 'bylaws',
        name: 'bylaws',
        component: () => import('../views/about/bylaws.vue')
      },
    ]
  },
  {
    path:'/question',
    name:'question',
    redirect: '/question/qinfo',
    component:question,
    children: [
      {
        path: 'qinfo',
        name: 'qinfo',
        component: () => import('../views/question/qinfo.vue')
      }
    ]
  },
  {
    path:'/cooperation',
    name:'cooperation',
    redirect: '/cooperation/union',
    component:  () => import('../views/cooperation.vue'),
    children: [
      {
        path: 'union',
        name: 'union',
        component: () => import('../views/cooperation/union.vue')
      }
    ]
  },
  {
    path: '/committee',
    name: 'committee',
    redirect: '/committee/apply',
    component: () => import('../views/committee.vue'),
    children: [
      {
        path: 'apply',
        name: 'apply',
        component: () => import('../views/committee/apply.vue')
      },
      {
        path: 'invitation',
        name: 'invitation',
        component: () => import('../views/committee/invitation.vue')
      },
      {
        path: 'mem',
        name: 'mem',
        component: () => import('../views/committee/mem.vue')
      },
      {
        path: 'load',
        name: 'load',
        component: () => import('../views/committee/load.vue')
      },
      {
        path: 'grload',
        name: 'grload',
        component: () => import('../views/committee/grload.vue')
      },
      {
        path: 'dwload',
        name: 'dwload',
        component: () => import('../views/committee/dwload.vue')
      }
    ]
  },
  // {
  //   path:'/member',
  //   name:'member',
  //   component:member,
  // },
  {
    path: '/new',
    name: 'new',
    component: () => import('../views/new.vue'),
    redirect: '/new/study',
    children: [
      {
        path: 'study',
        name: 'study',
        component: () => import('../views/new/study.vue')
      },
      {
        path: 'association',
        name: 'association',
        component: () => import('../views/new/association.vue')
      },
      {
        path: 'party',
        name: 'party',
        component: () => import('../views/new/party.vue')
      },
      {
        path: 'detail',
        name: 'detail',
        component: () => import('../views/new/detail.vue')
      }
    ]
  },
  {
    path: '*',
    redirect: '/'
  }
]

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

export default router
