index.js 3.4 KB
Newer Older
L
lin-xin 已提交
1 2 3 4 5 6 7 8 9
import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
L
lin-xin 已提交
10
            redirect: '/dashboard'
L
lin-xin 已提交
11 12
        },
        {
L
lin-xin 已提交
13
            path: '/',
L
lin-xin 已提交
14
            component: resolve => require(['../components/common/Home.vue'], resolve),
L
lin-xin 已提交
15
            meta: { title: '自述文件' },
L
lin-xin 已提交
16 17
            children:[
                {
L
lin-xin 已提交
18 19 20
                    path: '/dashboard',
                    component: resolve => require(['../components/page/Dashboard.vue'], resolve),
                    meta: { title: '系统首页' }
L
lin-xin 已提交
21 22
                },
                {
L
lin-xin 已提交
23
                    path: '/table',
L
lin-xin 已提交
24 25
                    component: resolve => require(['../components/page/BaseTable.vue'], resolve),
                    meta: { title: '基础表格' }
L
lin-xin 已提交
26
                },
L
lin-xin 已提交
27 28 29 30 31
                {
                    path: '/tabs',
                    component: resolve => require(['../components/page/Tabs.vue'], resolve),
                    meta: { title: 'tab选项卡' }
                },
L
lin-xin 已提交
32
                {
L
lin-xin 已提交
33
                    path: '/form',
L
lin-xin 已提交
34 35
                    component: resolve => require(['../components/page/BaseForm.vue'], resolve),
                    meta: { title: '基本表单' }
L
lin-xin 已提交
36 37
                },
                {
L
lin-xin 已提交
38
                    // 富文本编辑器组件
L
lin-xin 已提交
39
                    path: '/editor',
L
lin-xin 已提交
40 41
                    component: resolve => require(['../components/page/VueEditor.vue'], resolve),
                    meta: { title: '富文本编辑器' }
L
lin-xin 已提交
42 43 44 45
                },
                {
                    // markdown组件
                    path: '/markdown',
L
lin-xin 已提交
46 47
                    component: resolve => require(['../components/page/Markdown.vue'], resolve),
                    meta: { title: 'markdown编辑器' }    
L
lin-xin 已提交
48 49
                },
                {
L
lin-xin 已提交
50
                    // 图片上传组件
L
lin-xin 已提交
51
                    path: '/upload',
L
lin-xin 已提交
52 53
                    component: resolve => require(['../components/page/Upload.vue'], resolve),
                    meta: { title: '文件上传' }   
L
lin-xin 已提交
54 55 56
                },
                {
                    // vue-schart组件
L
lin-xin 已提交
57
                    path: '/charts',
L
lin-xin 已提交
58 59
                    component: resolve => require(['../components/page/BaseCharts.vue'], resolve),
                    meta: { title: 'schart图表' }
L
lin-xin 已提交
60 61 62 63
                },
                {
                    // 拖拽列表组件
                    path: '/drag',
L
lin-xin 已提交
64 65
                    component: resolve => require(['../components/page/DragList.vue'], resolve),
                    meta: { title: '拖拽列表' }
L
lin-xin 已提交
66 67 68 69 70
                },
                {
                    // 权限页面
                    path: '/permission',
                    component: resolve => require(['../components/page/Permission.vue'], resolve),
L
lin-xin 已提交
71
                    meta: { title: '权限测试', permission: true }
L
lin-xin 已提交
72 73 74 75 76 77 78
                }
            ]
        },
        {
            path: '/login',
            component: resolve => require(['../components/page/Login.vue'], resolve)
        },
L
lin-xin 已提交
79 80 81 82
        {
            path: '/404',
            component: resolve => require(['../components/page/404.vue'], resolve)
        },
L
lin-xin 已提交
83 84 85 86 87 88 89 90
        {
            path: '/403',
            component: resolve => require(['../components/page/403.vue'], resolve)
        },
        {
            path: '*',
            redirect: '/404'
        }
L
lin-xin 已提交
91 92
    ]
})