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

import Login from '../components/Login.vue'
import User from '../components/User.vue'
import Home from '../components/Home.vue'
import Base from '../components/Base.vue'
import Read from '../components/message/Read.vue'
import editMessage from '../components/message/EditMessage.vue'

Vue.use(VueRouter)

const routes = [
    { path: '/', redirect: '/login' },
    {
        path: '/login',
        component: Login
    },
    {
        path: '/user',
        component: User
    },
    {
        path: '/home',
        component: Home,
        redirect: '/base',
        children: [{
            path: '/base',
            component: Base
        }, {
            path: '/read',
            component: Read
        }, {
            path: '/editMessage',
            component: editMessage
        }]
    }
]

const router = new VueRouter({
    routes
})

export default router