import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

import Login from '../views/admin/Login.vue'
import AdminMain from '../views/admin/Main.vue'
import AdminList from '../views/admin/main/List.vue'
import AdminCreate from '../views/admin/main/Create.vue'

import User from '../views/user/User.vue'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },

  {
    path: '/login',
    name: 'Login',
    component: Login
  },

  {
    path: '/admin',
    component: AdminMain,
    children: [
      {
        path: '/',
        name:'Adminlist',
        component: AdminList,
      },        
      {
        path: '/create',
        name:'AdminCreate',
        component: AdminCreate
      },     
    ]
  },

  {
    path: '/user',
    name: 'User',
    component: User
  },
]

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

export default router
