routes.js
3.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
import DefaultLayout from '@/views/layout/default';
import ComponentLayout from '@/views/layout/component';
// 开发指南的文档
const _guides = [
{
path: 'introduce',
name: 'introduce',
meta: { title: '简介' },
component: () => import('@/views/docs/guide/introduce.md'),
},
{
path: 'installation',
name: 'installation',
meta: { title: '安装' },
component: () => import('@/views/docs/guide/installation.md'),
},
];
// 组件页面的文档
const _components = [
{
group: '表单',
children: [
{
path: 'select',
name: 'select',
meta: { title: 'Select 选择器' },
component: () => import('@/views/docs/component/select.md'),
},
{
path: 'keyword-input',
name: 'keyword-input',
meta: { title: 'KeywordInput 关键词输入器' },
component: () => import('@/views/docs/component/keyword-input.md'),
},
]
},
{
group: '高级',
children: [
{
path: 'detail',
name: 'detail',
meta: { title: 'Detail 详情' },
component: () => import('@/views/docs/component/detail.md'),
},
{
path: 'form',
name: 'form',
meta: { title: 'Form 表单' },
component: () => import('@/views/docs/component/form.md'),
},
{
path: 'search',
name: 'search',
meta: { title: 'Search 搜索' },
component: () => import('@/views/docs/component/search.md'),
},
{
path: 'table',
name: 'table',
meta: { title: 'Table 表格' },
component: () => import('@/views/docs/component/table.md'),
},
]
},
{
group: '业务',
children: [
{
path: 'scheme',
name: 'scheme',
meta: { title: 'Scheme 方案' },
component: () => import('@/views/docs/component/scheme.md'),
},
]
},
{
group: '其它',
children: [
{
path: 'specification',
name: 'specification',
meta: { title: 'Specification 说明' },
component: () => import('@/views/docs/component/specification.md'),
},
{
path: 'other',
name: 'other',
meta: { title: 'Other 其它' },
component: () => import('@/views/page/other'),
},
]
}
]
let _components_children = [];
_components.forEach(data => {
_components_children = [..._components_children, ...data.children]
});
// 用于导航的页面
const _pages = [
{
path: '',
meta: { title: '首页', path: '/index' },
component: DefaultLayout,
redirect: 'index',
children: [{
path: 'index',
name: 'index',
component: () => import('@/views/page/index'),
}],
},
{
path: '/component',
name: 'component',
meta: { title: '组件', path: '/component' },
component: ComponentLayout,
redirect: `/component/${_guides[0].path || 'detail'}`,
children: [..._components_children, ..._guides]
}
]
export const pages = _pages;
export const guides = _guides;
export const components = _components;
export default [
{ path: '*', redirect: '/404', hidden: true },
{
path: '/404',
name: '404',
component: () => import('@/views/page/error/404')
},
..._pages,
];