2019-01-12 03:33:27 +00:00
|
|
|
import Layout from './components/layout.vue';
|
|
|
|
import Iframe from './components/iframe.vue';
|
|
|
|
import demoRoutes from './demoRoutes';
|
|
|
|
import NProgress from 'nprogress';
|
2018-04-09 14:49:58 +00:00
|
|
|
|
2018-07-14 09:59:25 +00:00
|
|
|
const beforeEnter = (to, from, next) => {
|
2019-01-12 03:33:27 +00:00
|
|
|
NProgress.start();
|
|
|
|
next();
|
|
|
|
};
|
2018-04-04 10:39:21 +00:00
|
|
|
export default [
|
2019-01-12 03:33:27 +00:00
|
|
|
{
|
|
|
|
path: '/ant-design-vue/components',
|
2018-07-13 13:55:29 +00:00
|
|
|
component: Layout,
|
2019-01-12 03:33:27 +00:00
|
|
|
props: route => {
|
|
|
|
const name = route.path.split('/ant-design-vue/components/')[1].split('/')[0];
|
|
|
|
return { name, showDemo: true };
|
2018-07-13 13:55:29 +00:00
|
|
|
},
|
2019-01-12 03:33:27 +00:00
|
|
|
children: demoRoutes.map(item => ({
|
2018-07-14 09:59:25 +00:00
|
|
|
...item,
|
|
|
|
beforeEnter,
|
|
|
|
})),
|
2018-07-13 13:55:29 +00:00
|
|
|
},
|
2019-01-12 03:33:27 +00:00
|
|
|
{
|
|
|
|
path: '/ant-design-vue/iframe',
|
2018-07-13 13:55:29 +00:00
|
|
|
component: Iframe,
|
2019-01-12 03:33:27 +00:00
|
|
|
children: demoRoutes.map(item => ({
|
2018-07-13 13:55:29 +00:00
|
|
|
...item,
|
2019-01-12 03:33:27 +00:00
|
|
|
props: route => {
|
|
|
|
const hash = route.hash.replace('#', '');
|
|
|
|
return { iframeName: hash };
|
2018-07-13 13:55:29 +00:00
|
|
|
},
|
|
|
|
})),
|
|
|
|
},
|
2018-04-09 14:49:58 +00:00
|
|
|
{
|
2018-08-04 09:52:11 +00:00
|
|
|
path: '/ant-design-vue',
|
2018-04-09 14:49:58 +00:00
|
|
|
component: Layout,
|
2019-01-12 03:33:27 +00:00
|
|
|
props: route => {
|
|
|
|
const name = route.path.split('/docs/vue/')[1].split('/')[0];
|
|
|
|
return { name, showApi: true };
|
2018-04-09 14:49:58 +00:00
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{
|
2018-04-10 04:08:41 +00:00
|
|
|
path: 'docs/vue/customize-theme',
|
2018-04-09 14:49:58 +00:00
|
|
|
component: () => import('../docs/vue/customize-theme.en-US.md'),
|
2018-07-14 09:59:25 +00:00
|
|
|
beforeEnter,
|
2018-04-09 14:49:58 +00:00
|
|
|
},
|
|
|
|
{
|
2018-04-10 04:08:41 +00:00
|
|
|
path: 'docs/vue/customize-theme-cn',
|
2018-04-09 14:49:58 +00:00
|
|
|
component: () => import('../docs/vue/customize-theme.zh-CN.md'),
|
2018-07-14 09:59:25 +00:00
|
|
|
beforeEnter,
|
2018-04-09 14:49:58 +00:00
|
|
|
},
|
|
|
|
{
|
2018-04-10 04:08:41 +00:00
|
|
|
path: 'docs/vue/getting-started',
|
2018-04-09 14:49:58 +00:00
|
|
|
component: () => import('../docs/vue/getting-started.en-US.md'),
|
2018-07-14 09:59:25 +00:00
|
|
|
beforeEnter,
|
2018-04-09 14:49:58 +00:00
|
|
|
},
|
|
|
|
{
|
2018-04-10 04:08:41 +00:00
|
|
|
path: 'docs/vue/getting-started-cn',
|
2018-04-09 14:49:58 +00:00
|
|
|
component: () => import('../docs/vue/getting-started.zh-CN.md'),
|
2018-07-14 09:59:25 +00:00
|
|
|
beforeEnter,
|
2018-04-09 14:49:58 +00:00
|
|
|
},
|
|
|
|
{
|
2018-04-10 04:08:41 +00:00
|
|
|
path: 'docs/vue/i18n',
|
2018-04-09 14:49:58 +00:00
|
|
|
component: () => import('../docs/vue/i18n.en-US.md'),
|
2018-07-14 09:59:25 +00:00
|
|
|
beforeEnter,
|
2018-04-09 14:49:58 +00:00
|
|
|
},
|
|
|
|
{
|
2018-04-10 04:08:41 +00:00
|
|
|
path: 'docs/vue/i18n-cn',
|
2018-04-09 14:49:58 +00:00
|
|
|
component: () => import('../docs/vue/i18n.zh-CN.md'),
|
2018-07-14 09:59:25 +00:00
|
|
|
beforeEnter,
|
2018-04-09 14:49:58 +00:00
|
|
|
},
|
|
|
|
{
|
2018-04-10 04:08:41 +00:00
|
|
|
path: 'docs/vue/introduce',
|
2018-04-09 14:49:58 +00:00
|
|
|
component: () => import('../docs/vue/introduce.en-US.md'),
|
2018-07-14 09:59:25 +00:00
|
|
|
beforeEnter,
|
2018-04-09 14:49:58 +00:00
|
|
|
},
|
|
|
|
{
|
2018-04-10 04:08:41 +00:00
|
|
|
path: 'docs/vue/introduce-cn',
|
2018-04-09 14:49:58 +00:00
|
|
|
component: () => import('../docs/vue/introduce.zh-CN.md'),
|
2018-07-14 09:59:25 +00:00
|
|
|
beforeEnter,
|
2018-04-09 14:49:58 +00:00
|
|
|
},
|
|
|
|
{
|
2018-04-10 04:08:41 +00:00
|
|
|
path: 'docs/vue/use-with-vue-cli',
|
2018-04-09 14:49:58 +00:00
|
|
|
component: () => import('../docs/vue/use-with-vue-cli.en-US.md'),
|
2018-07-14 09:59:25 +00:00
|
|
|
beforeEnter,
|
2018-04-09 14:49:58 +00:00
|
|
|
},
|
|
|
|
{
|
2018-04-10 04:08:41 +00:00
|
|
|
path: 'docs/vue/use-with-vue-cli-cn',
|
2018-04-09 14:49:58 +00:00
|
|
|
component: () => import('../docs/vue/use-with-vue-cli.zh-CN.md'),
|
2018-07-14 09:59:25 +00:00
|
|
|
beforeEnter,
|
2018-04-09 14:49:58 +00:00
|
|
|
},
|
2018-12-14 13:35:19 +00:00
|
|
|
{
|
|
|
|
path: 'docs/vue/faq',
|
|
|
|
component: () => import('../docs/vue/faq.en-US.md'),
|
|
|
|
beforeEnter,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'docs/vue/faq-cn',
|
|
|
|
component: () => import('../docs/vue/faq.zh-CN.md'),
|
|
|
|
beforeEnter,
|
|
|
|
},
|
2019-01-12 09:19:57 +00:00
|
|
|
{
|
|
|
|
path: 'docs/vue/download',
|
|
|
|
component: () => import('../docs/vue/download.en-US.md'),
|
|
|
|
beforeEnter,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'docs/vue/download-cn',
|
|
|
|
component: () => import('../docs/vue/download.zh-CN.md'),
|
|
|
|
beforeEnter,
|
|
|
|
},
|
2018-12-14 13:35:19 +00:00
|
|
|
{
|
|
|
|
path: 'docs/vue/sponsor',
|
|
|
|
component: () => import('../docs/vue/sponsor.en-US.md'),
|
|
|
|
beforeEnter,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'docs/vue/sponsor-cn',
|
|
|
|
component: () => import('../docs/vue/sponsor.zh-CN.md'),
|
|
|
|
beforeEnter,
|
|
|
|
},
|
2018-04-21 10:50:10 +00:00
|
|
|
{
|
|
|
|
path: 'docs/vue/changelog',
|
|
|
|
component: () => import('../CHANGELOG.en-US.md'),
|
2018-07-14 09:59:25 +00:00
|
|
|
beforeEnter,
|
2018-04-21 10:50:10 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'docs/vue/changelog-cn',
|
|
|
|
component: () => import('../CHANGELOG.zh-CN.md'),
|
2018-07-14 09:59:25 +00:00
|
|
|
beforeEnter,
|
2018-04-21 10:50:10 +00:00
|
|
|
},
|
2018-08-04 09:52:11 +00:00
|
|
|
{ path: '', redirect: '/ant-design-vue/vue/docs/introduce/' },
|
2018-04-09 14:49:58 +00:00
|
|
|
],
|
|
|
|
},
|
2018-08-04 09:52:11 +00:00
|
|
|
{ path: '/*', redirect: '/ant-design-vue/docs/vue/introduce/' },
|
2019-01-12 03:33:27 +00:00
|
|
|
];
|