You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ant-design-vue/site/routes.js

105 lines
2.8 KiB

7 years ago
import Layout from './components/layout.vue'
import Iframe from './components/iframe.vue'
import demoRoutes from './demoRoutes'
import NProgress from 'nprogress'
7 years ago
const beforeEnter = (to, from, next) => {
NProgress.start()
next()
}
7 years ago
export default [
{ path: '/ant-design-vue/components',
component: Layout,
props: (route) => {
const name = route.path.split('/ant-design-vue/components/')[1].split('/')[0]
return { name, showDemo: true }
},
children: demoRoutes.map((item) => ({
...item,
beforeEnter,
})),
},
{ path: '/ant-design-vue/iframe',
component: Iframe,
children: demoRoutes.map((item) => ({
...item,
props: (route) => {
const hash = route.hash.replace('#', '')
return { iframeName: hash }
},
})),
},
7 years ago
{
path: '/ant-design-vue',
7 years ago
component: Layout,
props: (route) => {
7 years ago
const name = route.path.split('/docs/vue/')[1].split('/')[0]
return { name, showApi: true }
7 years ago
},
children: [
{
7 years ago
path: 'docs/vue/customize-theme',
7 years ago
component: () => import('../docs/vue/customize-theme.en-US.md'),
beforeEnter,
7 years ago
},
{
7 years ago
path: 'docs/vue/customize-theme-cn',
7 years ago
component: () => import('../docs/vue/customize-theme.zh-CN.md'),
beforeEnter,
7 years ago
},
{
7 years ago
path: 'docs/vue/getting-started',
7 years ago
component: () => import('../docs/vue/getting-started.en-US.md'),
beforeEnter,
7 years ago
},
{
7 years ago
path: 'docs/vue/getting-started-cn',
7 years ago
component: () => import('../docs/vue/getting-started.zh-CN.md'),
beforeEnter,
7 years ago
},
{
7 years ago
path: 'docs/vue/i18n',
7 years ago
component: () => import('../docs/vue/i18n.en-US.md'),
beforeEnter,
7 years ago
},
{
7 years ago
path: 'docs/vue/i18n-cn',
7 years ago
component: () => import('../docs/vue/i18n.zh-CN.md'),
beforeEnter,
7 years ago
},
{
7 years ago
path: 'docs/vue/introduce',
7 years ago
component: () => import('../docs/vue/introduce.en-US.md'),
beforeEnter,
7 years ago
},
{
7 years ago
path: 'docs/vue/introduce-cn',
7 years ago
component: () => import('../docs/vue/introduce.zh-CN.md'),
beforeEnter,
7 years ago
},
{
7 years ago
path: 'docs/vue/use-with-vue-cli',
7 years ago
component: () => import('../docs/vue/use-with-vue-cli.en-US.md'),
beforeEnter,
7 years ago
},
{
7 years ago
path: 'docs/vue/use-with-vue-cli-cn',
7 years ago
component: () => import('../docs/vue/use-with-vue-cli.zh-CN.md'),
beforeEnter,
7 years ago
},
{
path: 'docs/vue/changelog',
component: () => import('../CHANGELOG.en-US.md'),
beforeEnter,
},
{
path: 'docs/vue/changelog-cn',
component: () => import('../CHANGELOG.zh-CN.md'),
beforeEnter,
},
{ path: '', redirect: '/ant-design-vue/vue/docs/introduce/' },
7 years ago
],
},
{ path: '/*', redirect: '/ant-design-vue/docs/vue/introduce/' },
7 years ago
]