index.js 588 字节
Newer Older
Mr.奇淼('s avatar
Mr.奇淼( 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const baseRouters = [{
        path: '/',
        redirect: '/login'
    },
    {
        path: '/login',
        name: 'login',
        component: () =>
            import ('@/view/login/login.vue')
    },
    {
17 18
        path: '/register',
        name: 'register',
Mr.奇淼('s avatar
Mr.奇淼( 已提交
19
        component: () =>
20
            import ('@/view/login/register.vue')
Mr.奇淼('s avatar
Mr.奇淼( 已提交
21 22 23 24 25 26 27 28 29 30 31 32
    }
]

// 需要通过后台数据来生成的组件

const createRouter = () => new Router({
    routes: baseRouters
})

const router = createRouter()

export default router