naive-ui/demo/routes/routes.js

343 lines
8.2 KiB
JavaScript
Raw Normal View History

2020-03-19 18:26:48 +08:00
import { withPrefix } from './utils'
2021-02-14 14:52:14 +08:00
export const docChildRoutes = withPrefix('/:lang/:theme/docs', [
2020-06-18 01:33:55 +08:00
// basic docs
2020-12-12 13:51:22 +08:00
{
path: '/installation',
component: () => import('../pages/docs/installation/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/usage',
component: () => import('../pages/docs/usage/index.entry')
},
{
path: '/supported-platforms',
component: () => import('../pages/docs/supported-platforms/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/from-v1',
2021-02-14 14:52:14 +08:00
component: () => import('../pages/docs/vue3/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/experimental-features',
2021-02-14 14:52:14 +08:00
component: () => import('../pages/docs/experimental-features/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/changelog',
2021-02-14 14:52:14 +08:00
component: () => import('../pages/docs/changelog/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/theme',
2021-02-14 14:52:14 +08:00
component: () => import('../pages/docs/theme/index.entry')
}
])
export const componentChildRoutes = withPrefix('/:lang/:theme/components', [
2020-06-18 01:33:55 +08:00
// components
2020-12-12 13:51:22 +08:00
{
path: '/n-layout',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/layout/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-gradient-text',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/gradient-text/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-icon',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/icon/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-checkbox',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/checkbox/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-button',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/button/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-switch',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/switch/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-data-table',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/data-table/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-input',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/input/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-select',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/select/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-cascader',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/cascader/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-dynamic-input',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/dynamic-input/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-modal',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/modal/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-message',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/message/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-tooltip',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/tooltip/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-popover',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/popover/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-notification',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/notification/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-pagination',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/pagination/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-alert',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/alert/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-date-picker',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/date-picker/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-input-number',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/input-number/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-radio',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/radio/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-form',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/form/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-tabs',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/tabs/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-time-picker',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/time-picker/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-dialog',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/dialog/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-badge',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/badge/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-steps',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/steps/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-collapse',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/collapse/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-progress',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/progress/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-tag',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/tag/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-menu',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/menu/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-timeline',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/timeline/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-back-top',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/back-top/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-divider',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/divider/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-popconfirm',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/popconfirm/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-anchor',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/anchor/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-dropdown',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/dropdown/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-popselect',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/popselect/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-config-provider',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/config-provider/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-transfer',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/transfer/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-spin',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/spin/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-drawer',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/drawer/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-loading-bar',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/loading-bar/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-time',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/time/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-slider',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/slider/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-tree',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/tree/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-affix',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/affix/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-statistic',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/statistic/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-grid',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/grid/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-breadcrumb',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/breadcrumb/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-descriptions',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/descriptions/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-list',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/list/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-card',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/card/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-avatar',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/avatar/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-result',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/result/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-thing',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/thing/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-auto-complete',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/auto-complete/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-empty',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/empty/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-element',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/element/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-log',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/log/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-code',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/code/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-typography',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/typography/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-upload',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/upload/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-table',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/table/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-space',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/space/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-rate',
2021-01-12 19:58:41 +08:00
component: () => import('../../src/rate/demos/index.entry')
2020-12-12 13:51:22 +08:00
},
{
path: '/n-dynamic-tags',
component: () => import('../../src/dynamic-tags/demos/index.entry')
},
2020-06-18 01:33:55 +08:00
// deprecated
2020-12-12 13:51:22 +08:00
{
path: '/n-nimbus-service-layout',
component: () =>
2021-02-14 14:52:14 +08:00
import('../pages/docs/deprecated/nimbus-service-layout/index.entry')
2020-12-12 13:51:22 +08:00
}
2020-03-20 18:53:14 +08:00
])
2020-03-19 18:26:48 +08:00
export const routes = [
{
name: 'home',
2020-03-19 18:26:48 +08:00
path: '/:lang/:theme',
component: () => import('../pages/home/index.vue')
},
{
name: 'docs',
path: '/:lang/:theme/docs',
component: () => import('../pages/Layout.vue'),
children: docChildRoutes
},
{
name: 'components',
path: '/:lang/:theme/components',
component: () => import('../pages/Layout.vue'),
children: componentChildRoutes
2020-03-19 18:26:48 +08:00
},
{
name: 'not-found',
path: '/:pathMatch(.*)*',
2020-12-16 11:17:56 +08:00
redirect: {
name: 'home',
params: {
lang: 'zh-CN',
theme: 'os-theme'
}
}
2020-03-19 18:26:48 +08:00
}
]