import Vue from 'vue';
import Router from 'vue-router';
import User from '@/views/User.vue';
import App from '@/App.vue';
import AdminView from '@/views/AdminView.vue';
import HospitalView from '@/views/HospitalView.vue';

import Login from '@/views/Login.vue';
Vue.use(Router);


const routes = [
  {
    path: '/',
    name: 'App',
    component: App,
    children: [
      {
        path: 'user',
        name: 'UserView',
        component: User,
        meta:{ 
          isLogin:true
        }
      },
      {
        path: 'admin',
        name: 'AdminView',
        component: AdminView
      },
      {
        path: 'hospital',
        name: 'HospitalView',
        component: HospitalView,
      },
      {
        path: 'login',
        name: 'Login',
        component: Login
      }

    ]
  }

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



export default router