From 42b9102061a291cca728b65bfb38845c9bb87e69 Mon Sep 17 00:00:00 2001 From: 07akioni <07akioni2@gmail.com> Date: Sun, 14 Feb 2021 14:52:14 +0800 Subject: [PATCH] site: split docs/components pages --- demo/SiteHeader.vue | 23 +- demo/index.dev.js | 4 +- demo/index.ts-dev.js | 4 +- demo/pages/Layout.vue | 46 ++ .../doc/experimental-features/enUS/index.md | 39 - .../doc/experimental-features/zhCN/index.md | 39 - demo/pages/doc/index.vue | 42 - .../{doc => docs}/changelog/enUS/index.vue | 0 .../pages/{doc => docs}/changelog/index.entry | 0 .../{doc => docs}/changelog/zhCN/index.vue | 0 .../nimbus-service-layout/enUS/basic.demo.md | 2 +- .../enUS/index.demo-entry.md | 0 .../nimbus-service-layout/index.entry | 0 .../nimbus-service-layout/zhCN/basic.demo.md | 2 +- .../zhCN/index.demo-entry.md | 0 .../dev-guidelines/enUS/index.demo-entry.md | 0 .../{doc => docs}/dev-guidelines/index.entry | 0 .../dev-guidelines/zhCN/index.demo-entry.md | 0 .../docs/experimental-features/enUS/index.md | 66 ++ .../experimental-features/index.entry | 0 .../docs/experimental-features/zhCN/index.md | 66 ++ .../intro/enUS/index.demo-entry.md | 0 demo/pages/{doc => docs}/intro/index.entry | 0 .../intro/zhCN/index.demo-entry.md | 0 .../{doc => docs}/princinples/index.entry | 0 .../princinples/zhCN/index.demo-entry.md | 0 demo/pages/{doc => docs}/start/enUS/index.md | 0 demo/pages/{doc => docs}/start/index.entry | 0 demo/pages/{doc => docs}/start/zhCN/index.md | 0 .../{doc => docs}/theme/enUS/element.demo.md | 0 .../theme/enUS/index.demo-entry.md | 0 .../theme/enUS/provide-theme.demo.md | 0 demo/pages/{doc => docs}/theme/index.entry | 0 .../{doc => docs}/theme/zhCN/element.demo.md | 0 .../theme/zhCN/environment-debug.demo.md | 0 .../theme/zhCN/index.demo-entry.md | 0 .../theme/zhCN/provide-theme.demo.md | 0 .../theme/zhCN/read-theme-debug.demo.md | 0 .../theme/zhCN/style-scheme-debug.demo.md | 0 .../theme/zhCN/themed-style-debug.demo.md | 0 demo/pages/{doc => docs}/vue3/enUS/index.vue | 0 demo/pages/{doc => docs}/vue3/index.entry | 0 demo/pages/{doc => docs}/vue3/zhCN/index.vue | 0 demo/pages/{landing => home}/Footer.vue | 4 +- demo/pages/{landing => home}/Left.vue | 0 demo/pages/{landing => home}/Right.vue | 0 demo/pages/{landing => home}/index.vue | 3 +- demo/routes/debug-route-mixin.js | 2 +- demo/routes/routes.js | 42 +- demo/store/index.js | 22 +- demo/store/menu-options.js | 718 +++++++++--------- demo/utils/ComponentDocumentation.vue | 27 - .../src/ServiceLayout.ts | 6 +- .../nimbus-service-layout/src/interface.ts | 5 +- .../nimbus-service-layout/src/utils.ts | 11 +- 55 files changed, 630 insertions(+), 543 deletions(-) create mode 100644 demo/pages/Layout.vue delete mode 100644 demo/pages/doc/experimental-features/enUS/index.md delete mode 100644 demo/pages/doc/experimental-features/zhCN/index.md delete mode 100644 demo/pages/doc/index.vue rename demo/pages/{doc => docs}/changelog/enUS/index.vue (100%) rename demo/pages/{doc => docs}/changelog/index.entry (100%) rename demo/pages/{doc => docs}/changelog/zhCN/index.vue (100%) rename demo/pages/{doc => docs}/deprecated/nimbus-service-layout/enUS/basic.demo.md (98%) rename demo/pages/{doc => docs}/deprecated/nimbus-service-layout/enUS/index.demo-entry.md (100%) rename demo/pages/{doc => docs}/deprecated/nimbus-service-layout/index.entry (100%) rename demo/pages/{doc => docs}/deprecated/nimbus-service-layout/zhCN/basic.demo.md (98%) rename demo/pages/{doc => docs}/deprecated/nimbus-service-layout/zhCN/index.demo-entry.md (100%) rename demo/pages/{doc => docs}/dev-guidelines/enUS/index.demo-entry.md (100%) rename demo/pages/{doc => docs}/dev-guidelines/index.entry (100%) rename demo/pages/{doc => docs}/dev-guidelines/zhCN/index.demo-entry.md (100%) create mode 100644 demo/pages/docs/experimental-features/enUS/index.md rename demo/pages/{doc => docs}/experimental-features/index.entry (100%) create mode 100644 demo/pages/docs/experimental-features/zhCN/index.md rename demo/pages/{doc => docs}/intro/enUS/index.demo-entry.md (100%) rename demo/pages/{doc => docs}/intro/index.entry (100%) rename demo/pages/{doc => docs}/intro/zhCN/index.demo-entry.md (100%) rename demo/pages/{doc => docs}/princinples/index.entry (100%) rename demo/pages/{doc => docs}/princinples/zhCN/index.demo-entry.md (100%) rename demo/pages/{doc => docs}/start/enUS/index.md (100%) rename demo/pages/{doc => docs}/start/index.entry (100%) rename demo/pages/{doc => docs}/start/zhCN/index.md (100%) rename demo/pages/{doc => docs}/theme/enUS/element.demo.md (100%) rename demo/pages/{doc => docs}/theme/enUS/index.demo-entry.md (100%) rename demo/pages/{doc => docs}/theme/enUS/provide-theme.demo.md (100%) rename demo/pages/{doc => docs}/theme/index.entry (100%) rename demo/pages/{doc => docs}/theme/zhCN/element.demo.md (100%) rename demo/pages/{doc => docs}/theme/zhCN/environment-debug.demo.md (100%) rename demo/pages/{doc => docs}/theme/zhCN/index.demo-entry.md (100%) rename demo/pages/{doc => docs}/theme/zhCN/provide-theme.demo.md (100%) rename demo/pages/{doc => docs}/theme/zhCN/read-theme-debug.demo.md (100%) rename demo/pages/{doc => docs}/theme/zhCN/style-scheme-debug.demo.md (100%) rename demo/pages/{doc => docs}/theme/zhCN/themed-style-debug.demo.md (100%) rename demo/pages/{doc => docs}/vue3/enUS/index.vue (100%) rename demo/pages/{doc => docs}/vue3/index.entry (100%) rename demo/pages/{doc => docs}/vue3/zhCN/index.vue (100%) rename demo/pages/{landing => home}/Footer.vue (86%) rename demo/pages/{landing => home}/Left.vue (100%) rename demo/pages/{landing => home}/Right.vue (100%) rename demo/pages/{landing => home}/index.vue (98%) diff --git a/demo/SiteHeader.vue b/demo/SiteHeader.vue index 527da7b81..1332bf36b 100644 --- a/demo/SiteHeader.vue +++ b/demo/SiteHeader.vue @@ -76,6 +76,7 @@ export default { searchPlaceholder: '搜索', home: '首页', doc: '文档', + component: '组件', common: '常规', debug: '调试', alreadyHome: '别点了,你已经在首页了' @@ -86,6 +87,7 @@ export default { searchPlaceholder: 'Search', home: 'Home', doc: 'Documentation', + component: 'Component', common: 'Common', debug: 'Debug', alreadyHome: "You've already been in home page. No clicking." @@ -94,12 +96,16 @@ export default { const menuItemsRef = computed(() => { return [ { - name: 'home', + key: 'home', title: t('home') }, { - name: 'doc', + key: 'doc', title: t('doc') + }, + { + key: 'component', + title: t('component') } ] }) @@ -192,10 +198,19 @@ export default { this.$router.push(/^(\/[^/]+){2}/.exec(this.$route.path)[0]) } if (value === 'doc') { - if (/^(\/[^/]+){2}\/doc/.test(this.$route.path)) { + if (/^(\/[^/]+){2}\/docs/.test(this.$route.path)) { } else { this.$router.push( - /^(\/[^/]+){2}/.exec(this.$route.path)[0] + '/doc/start' + /^(\/[^/]+){2}/.exec(this.$route.path)[0] + '/docs/start' + ) + } + } + if (value === 'component') { + if (/^(\/[^/]+){2}\/components/.test(this.$route.path)) { + } else { + this.$router.push( + /^(\/[^/]+){2}/.exec(this.$route.path)[0] + + '/components/n-config-provider' ) } } diff --git a/demo/index.dev.js b/demo/index.dev.js index 6963eddb9..29ecca61e 100644 --- a/demo/index.dev.js +++ b/demo/index.dev.js @@ -2,11 +2,11 @@ import { createApp } from 'vue' import { installDemoComponents } from './init' import SiteRoot from './SiteRoot.vue' import naive from '../src/index' -import { routes, childRoutes } from './routes/routes' +import { routes, componentChildRoutes } from './routes/routes' import createDemoRouter from './routes/router' import debugRouteMixin from './routes/debug-route-mixin' -debugRouteMixin(routes, childRoutes) +debugRouteMixin(routes, componentChildRoutes) const app = createApp(SiteRoot) diff --git a/demo/index.ts-dev.js b/demo/index.ts-dev.js index 2edf4aa61..17735912d 100644 --- a/demo/index.ts-dev.js +++ b/demo/index.ts-dev.js @@ -2,11 +2,11 @@ import { createApp } from 'vue' import { installDemoComponents } from './init' import SiteRoot from './TsSiteRoot.vue' import naive from '../src/index' -import { routes, childRoutes } from './routes/routes' +import { routes, componentChildRoutes } from './routes/routes' import createDemoRouter from './routes/router' import debugRouteMixin from './routes/debug-route-mixin' -debugRouteMixin(routes, childRoutes) +debugRouteMixin(routes, componentChildRoutes) const app = createApp(SiteRoot) diff --git a/demo/pages/Layout.vue b/demo/pages/Layout.vue new file mode 100644 index 000000000..7c6e01f38 --- /dev/null +++ b/demo/pages/Layout.vue @@ -0,0 +1,46 @@ + + + diff --git a/demo/pages/doc/experimental-features/enUS/index.md b/demo/pages/doc/experimental-features/enUS/index.md deleted file mode 100644 index 669ba9b02..000000000 --- a/demo/pages/doc/experimental-features/enUS/index.md +++ /dev/null @@ -1,39 +0,0 @@ - - -# Experimental Features - - - The following features are unstable. Use them if you really need and perpare to follow the API changes. - - -## Customize Theme - -```js -// ... - -import naive from 'naive-ui' - -naive.styles.light.override({ - derived: { - primaryColor: 'rgb(255, 0, 0)', - primaryHoverColor: 'rgb(0, 255, 0)', - primaryActiveColor: 'rgb(0, 0, 255)' - } -}) - -Vue.use(naive) -``` - -For specific variables, please see source code. - -### Use Tusimple Theme - -```js -// ... -import tusimpleTheme from 'naive-ui/themes/tusimple' -import naive from 'naive-ui' - -naive.use(tusimpleTheme) - -Vue.use(naive) -``` diff --git a/demo/pages/doc/experimental-features/zhCN/index.md b/demo/pages/doc/experimental-features/zhCN/index.md deleted file mode 100644 index 3c8731f8a..000000000 --- a/demo/pages/doc/experimental-features/zhCN/index.md +++ /dev/null @@ -1,39 +0,0 @@ - - -# 试验性特性 - - - 下列的所有功能都是不稳定的。只在真的需要的时候再使用他们,API 有可能在未来被改变。 - - -## 定制主题 - -```js -// ... - -import naive from 'naive-ui' - -naive.styles.light.override({ - derived: { - primaryColor: 'rgb(255, 0, 0)', - primaryColorHover: 'rgb(0, 255, 0)', - primaryColorActive: 'rgb(0, 0, 255)' - } -}) - -Vue.use(naive) -``` - -具体可使用变量请参考源码。 - -### 使用图森主题 - -```js -// ... -import tusimpleTheme from 'naive-ui/themes/tusimple' -import naive from 'naive-ui' - -naive.use(tusimpleTheme) - -Vue.use(naive) -``` diff --git a/demo/pages/doc/index.vue b/demo/pages/doc/index.vue deleted file mode 100644 index 0d15df22a..000000000 --- a/demo/pages/doc/index.vue +++ /dev/null @@ -1,42 +0,0 @@ - - - diff --git a/demo/pages/doc/changelog/enUS/index.vue b/demo/pages/docs/changelog/enUS/index.vue similarity index 100% rename from demo/pages/doc/changelog/enUS/index.vue rename to demo/pages/docs/changelog/enUS/index.vue diff --git a/demo/pages/doc/changelog/index.entry b/demo/pages/docs/changelog/index.entry similarity index 100% rename from demo/pages/doc/changelog/index.entry rename to demo/pages/docs/changelog/index.entry diff --git a/demo/pages/doc/changelog/zhCN/index.vue b/demo/pages/docs/changelog/zhCN/index.vue similarity index 100% rename from demo/pages/doc/changelog/zhCN/index.vue rename to demo/pages/docs/changelog/zhCN/index.vue diff --git a/demo/pages/doc/deprecated/nimbus-service-layout/enUS/basic.demo.md b/demo/pages/docs/deprecated/nimbus-service-layout/enUS/basic.demo.md similarity index 98% rename from demo/pages/doc/deprecated/nimbus-service-layout/enUS/basic.demo.md rename to demo/pages/docs/deprecated/nimbus-service-layout/enUS/basic.demo.md index 1a725fa19..237979a7d 100644 --- a/demo/pages/doc/deprecated/nimbus-service-layout/enUS/basic.demo.md +++ b/demo/pages/docs/deprecated/nimbus-service-layout/enUS/basic.demo.md @@ -39,7 +39,7 @@ export default { }, { name: 'Morning Glory', - childItems: [ + children: [ { name: 'Hello', path: '/en-US/dark/n-nimbus-service-layout?param=777' diff --git a/demo/pages/doc/deprecated/nimbus-service-layout/enUS/index.demo-entry.md b/demo/pages/docs/deprecated/nimbus-service-layout/enUS/index.demo-entry.md similarity index 100% rename from demo/pages/doc/deprecated/nimbus-service-layout/enUS/index.demo-entry.md rename to demo/pages/docs/deprecated/nimbus-service-layout/enUS/index.demo-entry.md diff --git a/demo/pages/doc/deprecated/nimbus-service-layout/index.entry b/demo/pages/docs/deprecated/nimbus-service-layout/index.entry similarity index 100% rename from demo/pages/doc/deprecated/nimbus-service-layout/index.entry rename to demo/pages/docs/deprecated/nimbus-service-layout/index.entry diff --git a/demo/pages/doc/deprecated/nimbus-service-layout/zhCN/basic.demo.md b/demo/pages/docs/deprecated/nimbus-service-layout/zhCN/basic.demo.md similarity index 98% rename from demo/pages/doc/deprecated/nimbus-service-layout/zhCN/basic.demo.md rename to demo/pages/docs/deprecated/nimbus-service-layout/zhCN/basic.demo.md index 1a725fa19..237979a7d 100644 --- a/demo/pages/doc/deprecated/nimbus-service-layout/zhCN/basic.demo.md +++ b/demo/pages/docs/deprecated/nimbus-service-layout/zhCN/basic.demo.md @@ -39,7 +39,7 @@ export default { }, { name: 'Morning Glory', - childItems: [ + children: [ { name: 'Hello', path: '/en-US/dark/n-nimbus-service-layout?param=777' diff --git a/demo/pages/doc/deprecated/nimbus-service-layout/zhCN/index.demo-entry.md b/demo/pages/docs/deprecated/nimbus-service-layout/zhCN/index.demo-entry.md similarity index 100% rename from demo/pages/doc/deprecated/nimbus-service-layout/zhCN/index.demo-entry.md rename to demo/pages/docs/deprecated/nimbus-service-layout/zhCN/index.demo-entry.md diff --git a/demo/pages/doc/dev-guidelines/enUS/index.demo-entry.md b/demo/pages/docs/dev-guidelines/enUS/index.demo-entry.md similarity index 100% rename from demo/pages/doc/dev-guidelines/enUS/index.demo-entry.md rename to demo/pages/docs/dev-guidelines/enUS/index.demo-entry.md diff --git a/demo/pages/doc/dev-guidelines/index.entry b/demo/pages/docs/dev-guidelines/index.entry similarity index 100% rename from demo/pages/doc/dev-guidelines/index.entry rename to demo/pages/docs/dev-guidelines/index.entry diff --git a/demo/pages/doc/dev-guidelines/zhCN/index.demo-entry.md b/demo/pages/docs/dev-guidelines/zhCN/index.demo-entry.md similarity index 100% rename from demo/pages/doc/dev-guidelines/zhCN/index.demo-entry.md rename to demo/pages/docs/dev-guidelines/zhCN/index.demo-entry.md diff --git a/demo/pages/docs/experimental-features/enUS/index.md b/demo/pages/docs/experimental-features/enUS/index.md new file mode 100644 index 000000000..2dd8aac9a --- /dev/null +++ b/demo/pages/docs/experimental-features/enUS/index.md @@ -0,0 +1,66 @@ + + +# Experimental Features + + + The following features are unstable. Use them if you really need and perpare to follow the API changes. + + +## Customize Theme + +```html + + + +``` + +For specific variables, please follow `GlobalThemeOverrides` type hint. + +## Use Tusimple Theme + +```html + + + +``` diff --git a/demo/pages/doc/experimental-features/index.entry b/demo/pages/docs/experimental-features/index.entry similarity index 100% rename from demo/pages/doc/experimental-features/index.entry rename to demo/pages/docs/experimental-features/index.entry diff --git a/demo/pages/docs/experimental-features/zhCN/index.md b/demo/pages/docs/experimental-features/zhCN/index.md new file mode 100644 index 000000000..3141290df --- /dev/null +++ b/demo/pages/docs/experimental-features/zhCN/index.md @@ -0,0 +1,66 @@ + + +# 试验性特性 + + + 下列的所有功能都是不稳定的。只在真的需要的时候再使用他们,API 有可能在未来被改变。 + + +## 定制主题 + +```html + + + +``` + +具体可使用变量请参考 `GlobalThemeOverrides` 类型提示。 + +## 使用图森主题 + +```html + + + +``` diff --git a/demo/pages/doc/intro/enUS/index.demo-entry.md b/demo/pages/docs/intro/enUS/index.demo-entry.md similarity index 100% rename from demo/pages/doc/intro/enUS/index.demo-entry.md rename to demo/pages/docs/intro/enUS/index.demo-entry.md diff --git a/demo/pages/doc/intro/index.entry b/demo/pages/docs/intro/index.entry similarity index 100% rename from demo/pages/doc/intro/index.entry rename to demo/pages/docs/intro/index.entry diff --git a/demo/pages/doc/intro/zhCN/index.demo-entry.md b/demo/pages/docs/intro/zhCN/index.demo-entry.md similarity index 100% rename from demo/pages/doc/intro/zhCN/index.demo-entry.md rename to demo/pages/docs/intro/zhCN/index.demo-entry.md diff --git a/demo/pages/doc/princinples/index.entry b/demo/pages/docs/princinples/index.entry similarity index 100% rename from demo/pages/doc/princinples/index.entry rename to demo/pages/docs/princinples/index.entry diff --git a/demo/pages/doc/princinples/zhCN/index.demo-entry.md b/demo/pages/docs/princinples/zhCN/index.demo-entry.md similarity index 100% rename from demo/pages/doc/princinples/zhCN/index.demo-entry.md rename to demo/pages/docs/princinples/zhCN/index.demo-entry.md diff --git a/demo/pages/doc/start/enUS/index.md b/demo/pages/docs/start/enUS/index.md similarity index 100% rename from demo/pages/doc/start/enUS/index.md rename to demo/pages/docs/start/enUS/index.md diff --git a/demo/pages/doc/start/index.entry b/demo/pages/docs/start/index.entry similarity index 100% rename from demo/pages/doc/start/index.entry rename to demo/pages/docs/start/index.entry diff --git a/demo/pages/doc/start/zhCN/index.md b/demo/pages/docs/start/zhCN/index.md similarity index 100% rename from demo/pages/doc/start/zhCN/index.md rename to demo/pages/docs/start/zhCN/index.md diff --git a/demo/pages/doc/theme/enUS/element.demo.md b/demo/pages/docs/theme/enUS/element.demo.md similarity index 100% rename from demo/pages/doc/theme/enUS/element.demo.md rename to demo/pages/docs/theme/enUS/element.demo.md diff --git a/demo/pages/doc/theme/enUS/index.demo-entry.md b/demo/pages/docs/theme/enUS/index.demo-entry.md similarity index 100% rename from demo/pages/doc/theme/enUS/index.demo-entry.md rename to demo/pages/docs/theme/enUS/index.demo-entry.md diff --git a/demo/pages/doc/theme/enUS/provide-theme.demo.md b/demo/pages/docs/theme/enUS/provide-theme.demo.md similarity index 100% rename from demo/pages/doc/theme/enUS/provide-theme.demo.md rename to demo/pages/docs/theme/enUS/provide-theme.demo.md diff --git a/demo/pages/doc/theme/index.entry b/demo/pages/docs/theme/index.entry similarity index 100% rename from demo/pages/doc/theme/index.entry rename to demo/pages/docs/theme/index.entry diff --git a/demo/pages/doc/theme/zhCN/element.demo.md b/demo/pages/docs/theme/zhCN/element.demo.md similarity index 100% rename from demo/pages/doc/theme/zhCN/element.demo.md rename to demo/pages/docs/theme/zhCN/element.demo.md diff --git a/demo/pages/doc/theme/zhCN/environment-debug.demo.md b/demo/pages/docs/theme/zhCN/environment-debug.demo.md similarity index 100% rename from demo/pages/doc/theme/zhCN/environment-debug.demo.md rename to demo/pages/docs/theme/zhCN/environment-debug.demo.md diff --git a/demo/pages/doc/theme/zhCN/index.demo-entry.md b/demo/pages/docs/theme/zhCN/index.demo-entry.md similarity index 100% rename from demo/pages/doc/theme/zhCN/index.demo-entry.md rename to demo/pages/docs/theme/zhCN/index.demo-entry.md diff --git a/demo/pages/doc/theme/zhCN/provide-theme.demo.md b/demo/pages/docs/theme/zhCN/provide-theme.demo.md similarity index 100% rename from demo/pages/doc/theme/zhCN/provide-theme.demo.md rename to demo/pages/docs/theme/zhCN/provide-theme.demo.md diff --git a/demo/pages/doc/theme/zhCN/read-theme-debug.demo.md b/demo/pages/docs/theme/zhCN/read-theme-debug.demo.md similarity index 100% rename from demo/pages/doc/theme/zhCN/read-theme-debug.demo.md rename to demo/pages/docs/theme/zhCN/read-theme-debug.demo.md diff --git a/demo/pages/doc/theme/zhCN/style-scheme-debug.demo.md b/demo/pages/docs/theme/zhCN/style-scheme-debug.demo.md similarity index 100% rename from demo/pages/doc/theme/zhCN/style-scheme-debug.demo.md rename to demo/pages/docs/theme/zhCN/style-scheme-debug.demo.md diff --git a/demo/pages/doc/theme/zhCN/themed-style-debug.demo.md b/demo/pages/docs/theme/zhCN/themed-style-debug.demo.md similarity index 100% rename from demo/pages/doc/theme/zhCN/themed-style-debug.demo.md rename to demo/pages/docs/theme/zhCN/themed-style-debug.demo.md diff --git a/demo/pages/doc/vue3/enUS/index.vue b/demo/pages/docs/vue3/enUS/index.vue similarity index 100% rename from demo/pages/doc/vue3/enUS/index.vue rename to demo/pages/docs/vue3/enUS/index.vue diff --git a/demo/pages/doc/vue3/index.entry b/demo/pages/docs/vue3/index.entry similarity index 100% rename from demo/pages/doc/vue3/index.entry rename to demo/pages/docs/vue3/index.entry diff --git a/demo/pages/doc/vue3/zhCN/index.vue b/demo/pages/docs/vue3/zhCN/index.vue similarity index 100% rename from demo/pages/doc/vue3/zhCN/index.vue rename to demo/pages/docs/vue3/zhCN/index.vue diff --git a/demo/pages/landing/Footer.vue b/demo/pages/home/Footer.vue similarity index 86% rename from demo/pages/landing/Footer.vue rename to demo/pages/home/Footer.vue index 1a4f16593..bf1db7b1d 100644 --- a/demo/pages/landing/Footer.vue +++ b/demo/pages/home/Footer.vue @@ -1,9 +1,7 @@ diff --git a/demo/pages/landing/Left.vue b/demo/pages/home/Left.vue similarity index 100% rename from demo/pages/landing/Left.vue rename to demo/pages/home/Left.vue diff --git a/demo/pages/landing/Right.vue b/demo/pages/home/Right.vue similarity index 100% rename from demo/pages/landing/Right.vue rename to demo/pages/home/Right.vue diff --git a/demo/pages/landing/index.vue b/demo/pages/home/index.vue similarity index 98% rename from demo/pages/landing/index.vue rename to demo/pages/home/index.vue index dc1cf52b9..3d10974d3 100644 --- a/demo/pages/landing/index.vue +++ b/demo/pages/home/index.vue @@ -10,7 +10,8 @@ Na{{ hover ? 'ï' : 'i' }}ve UI + >Na{{ hover ? 'ï' : 'i' }}ve UI {{ t('intro1') }} diff --git a/demo/routes/debug-route-mixin.js b/demo/routes/debug-route-mixin.js index a26ca793e..cbea7cca7 100644 --- a/demo/routes/debug-route-mixin.js +++ b/demo/routes/debug-route-mixin.js @@ -55,7 +55,7 @@ const childDebugRoutes = [ ] export default function debugRouteMixin (routes, childRoutes) { - childRoutes.unshift(...withPrefix('/:lang/:theme/doc', childDebugRoutes)) + childRoutes.unshift(...withPrefix('/:lang/:theme/docs', childDebugRoutes)) // routes[0].children[1].children = childRoutes routes.unshift(...rootDebugRoutes) } diff --git a/demo/routes/routes.js b/demo/routes/routes.js index b36e8de95..2411afe30 100644 --- a/demo/routes/routes.js +++ b/demo/routes/routes.js @@ -1,35 +1,39 @@ import { withPrefix } from './utils' +import Site from '../Site.vue' -export const childRoutes = withPrefix('/:lang/:theme/doc', [ +export const docChildRoutes = withPrefix('/:lang/:theme/docs', [ // basic docs { path: '/intro', - component: () => import('../pages/doc/intro/index.entry') + component: () => import('../pages/docs/intro/index.entry') }, { path: '/start', - component: () => import('../pages/doc/start/index.entry') + component: () => import('../pages/docs/start/index.entry') }, { path: '/from-v1', - component: () => import('../pages/doc/vue3/index.entry') + component: () => import('../pages/docs/vue3/index.entry') }, { path: '/experimental-features', - component: () => import('../pages/doc/experimental-features/index.entry') + component: () => import('../pages/docs/experimental-features/index.entry') }, { path: '/changelog', - component: () => import('../pages/doc/changelog/index.entry') + component: () => import('../pages/docs/changelog/index.entry') }, { path: '/dev-guidelines', - component: () => import('../pages/doc/dev-guidelines/index.entry') + component: () => import('../pages/docs/dev-guidelines/index.entry') }, { path: '/n-theme', - component: () => import('../pages/doc/theme/index.entry') - }, + component: () => import('../pages/docs/theme/index.entry') + } +]) + +export const componentChildRoutes = withPrefix('/:lang/:theme/components', [ // components { path: '/n-layout', @@ -303,7 +307,7 @@ export const childRoutes = withPrefix('/:lang/:theme/doc', [ { path: '/n-nimbus-service-layout', component: () => - import('../pages/doc/deprecated/nimbus-service-layout/index.entry') + import('../pages/docs/deprecated/nimbus-service-layout/index.entry') } ]) @@ -311,18 +315,24 @@ export const routes = [ { name: 'site', path: '/:lang/:theme', - component: () => import('../Site.vue'), + component: Site, children: [ { name: 'home', path: '/:lang/:theme', - component: () => import('../pages/landing/index.vue') + component: () => import('../pages/home/index.vue') }, { - name: 'doc', - path: '/:lang/:theme/doc', - component: () => import('../pages/doc/index.vue'), - children: childRoutes + 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 } ] }, diff --git a/demo/store/index.js b/demo/store/index.js index e5b028c62..ad2503ad9 100644 --- a/demo/store/index.js +++ b/demo/store/index.js @@ -9,7 +9,10 @@ import { useOsTheme } from '../../src' import { i18n } from '../utils/composables' -import menuOptions from './menu-options' +import { + createDocumentationMenuOptions, + createComponentMenuOptions +} from './menu-options' import hljs from './hljs' const storeKey = 'site-store' @@ -66,7 +69,14 @@ export function siteSetup () { }) // options const docOptionsRef = computed(() => - menuOptions({ + createDocumentationMenuOptions({ + theme: themeNameRef.value, + lang: localeNameRef.value, + mode: displayModeRef.value + }) + ) + const componentOptionsRef = computed(() => + createComponentMenuOptions({ theme: themeNameRef.value, lang: localeNameRef.value, mode: displayModeRef.value @@ -77,12 +87,13 @@ export function siteSetup () { const traverse = (items) => { if (items) { items.forEach((item) => { - if (item.childItems) traverse(item.childItems) + if (item.children) traverse(item.children) else flattenedItems.push(item) }) } } traverse(docOptionsRef.value) + traverse(componentOptionsRef.value) return flattenedItems }) provide( @@ -92,6 +103,7 @@ export function siteSetup () { localeName: localeNameRef, displayMode: displayModeRef, docOptions: docOptionsRef, + componentOptions: componentOptionsRef, flattenedDocOptions: flattenedDocOptionsRef }) ) @@ -130,6 +142,10 @@ export function useDocOptions () { return toRef(inject(storeKey), 'docOptions') } +export function useComponentOptions () { + return toRef(inject(storeKey), 'componentOptions') +} + export function useFlattenedDocOptions () { return toRef(inject(storeKey), 'flattenedDocOptions') } diff --git a/demo/store/menu-options.js b/demo/store/menu-options.js index d8aa87cd5..7e7f11f9f 100644 --- a/demo/store/menu-options.js +++ b/demo/store/menu-options.js @@ -1,13 +1,13 @@ // rubbish code here const appendCounts = (item) => { - if (!item.childItems) { + if (!item.children) { item.count = 1 return item } - if (item.childItems) { - item.childItems.forEach(appendCounts) - item.count = item.childItems.reduce((sum, item) => sum + item.count, 0) + if (item.children) { + item.children.forEach(appendCounts) + item.count = item.children.reduce((sum, item) => sum + item.count, 0) item.name += ` (${item.count})` if (item.type === 'group' && item.title) item.title += ` (${item.count})` return item @@ -26,511 +26,521 @@ const createDebugDemos = (item, mode) => { } else return [] } -function createItems (lang, items) { - if (lang === 'zh-CN') return items - function traverse (children) { - children.forEach((child) => { - child.title = undefined - child.titleExtra = undefined - if (child.childItems) { - traverse(child.childItems) - } - }) - } - traverse(items) - return items +function createItems (lang, theme, prefix, items) { + const isZh = lang === 'zh-CN' + const langKey = isZh ? 'zh' : 'en' + return items.map((rawItem) => { + const item = { + ...rawItem, + key: rawItem.en, + title: rawItem[langKey], + enSuffix: true, + path: rawItem.path + ? `/${lang}/${theme}` + prefix + rawItem.path + : undefined + } + if (rawItem.children) { + item.children = createItems(lang, theme, prefix, rawItem.children) + } + return item + }) } -export default function (instance) { - const { lang, theme, mode } = instance - return createItems(lang, [ +export function createDocumentationMenuOptions ({ lang, theme, mode }) { + return createItems(lang, theme, '/docs', [ { - name: 'Naive UI', - path: `/${lang}/${theme}/doc` + '/intro' + en: 'Naive UI', + zh: 'Naive UI', + path: '/intro' }, { - name: 'Get Started', - title: '起步', - path: `/${lang}/${theme}/doc` + '/start' + en: 'Get Started', + zh: '起步', + path: '/start' }, { - name: 'Change Log', - title: '变更日志', - path: `/${lang}/${theme}/doc` + '/changelog' + en: 'Change Log', + zh: '变更日志', + path: '/changelog' }, { - name: 'Migrate From V1', - title: '从 V1 升级', - path: `/${lang}/${theme}/doc` + '/from-v1' + en: 'Migrate From V1', + zh: '从 V1 升级', + path: '/from-v1' }, { - name: 'Create Themed Component', - title: '创建适配主题的组件', - path: `/${lang}/${theme}/doc` + '/n-theme' + en: 'Create Themed Component', + zh: '创建适配主题的组件', + path: '/n-theme' }, { - name: 'Experimental Features', - title: '试验性特性', - path: `/${lang}/${theme}/doc` + '/experimental-features' - }, + en: 'Experimental Features', + zh: '试验性特性', + path: '/experimental-features' + } + ]) +} + +export function createComponentMenuOptions ({ lang, theme, mode }) { + return createItems(lang, theme, '/components', [ appendCounts({ - title: '配置组件', - name: 'Config Components', + zh: '配置组件', + en: 'Config Components', type: 'group', - childItems: [ + children: [ { - name: 'Config Provider', - title: '配置提供者', - titleExtra: 'Config Provider', - path: `/${lang}/${theme}/doc` + '/n-config-provider' + en: 'Config Provider', + zh: '配置提供者', + enSuffix: true, + path: '/n-config-provider' }, { - name: 'Element', - title: '元素', - titleExtra: 'Element', - path: `/${lang}/${theme}/doc` + '/n-element' + en: 'Element', + zh: '元素', + enSuffix: true, + path: '/n-element' } ] }), appendCounts({ - title: '布局组件', - name: 'Layout Components', + zh: '布局组件', + en: 'Layout Components', type: 'group', - childItems: [ + children: [ { - name: 'Layout', - title: '布局', - titleExtra: 'Layout', - path: `/${lang}/${theme}/doc` + '/n-layout' + en: 'Layout', + zh: '布局', + enSuffix: true, + path: '/n-layout' }, { - name: 'Grid', - title: '栅格', - titleExtra: 'Grid', - path: `/${lang}/${theme}/doc` + '/n-grid' + en: 'Grid', + zh: '栅格', + enSuffix: true, + path: '/n-grid' }, { - name: 'Space', - title: '间距', - titleExtra: 'Space', - path: `/${lang}/${theme}/doc` + '/n-space' + en: 'Space', + zh: '间距', + enSuffix: true, + path: '/n-space' } ] }), appendCounts({ - title: '通用组件', - name: 'Common Components', + zh: '通用组件', + en: 'Common Components', type: 'group', - childItems: [ + children: [ { - name: 'Avatar', - title: '头像', - titleExtra: 'Avatar', - path: `/${lang}/${theme}/doc` + '/n-avatar' + en: 'Avatar', + zh: '头像', + enSuffix: true, + path: '/n-avatar' }, { - name: 'Button', - title: '按钮', - titleExtra: 'Button', - path: `/${lang}/${theme}/doc` + '/n-button' + en: 'Button', + zh: '按钮', + enSuffix: true, + path: '/n-button' }, { - name: 'Card', - title: '卡片', - titleExtra: 'Card', - path: `/${lang}/${theme}/doc` + '/n-card' + en: 'Card', + zh: '卡片', + enSuffix: true, + path: '/n-card' }, { - name: 'Collapse', - title: '折叠面板', - titleExtra: 'Collapse', - path: `/${lang}/${theme}/doc` + '/n-collapse' + en: 'Collapse', + zh: '折叠面板', + enSuffix: true, + path: '/n-collapse' }, { - name: 'Divider', - title: '分割线', - titleExtra: 'Divider', - path: `/${lang}/${theme}/doc` + '/n-divider' + en: 'Divider', + zh: '分割线', + enSuffix: true, + path: '/n-divider' }, { - name: 'Dropdown', - title: '下拉菜单', - titleExtra: 'Dropdown', - path: `/${lang}/${theme}/doc` + '/n-dropdown' + en: 'Dropdown', + zh: '下拉菜单', + enSuffix: true, + path: '/n-dropdown' }, { - name: 'Gradient Text', - title: '渐变文字', - titleExtra: 'Gradient Text', - path: `/${lang}/${theme}/doc` + '/n-gradient-text' + en: 'Gradient Text', + zh: '渐变文字', + enSuffix: true, + path: '/n-gradient-text' }, { - name: 'Icon', - title: '图标', - titleExtra: 'Icon', - path: `/${lang}/${theme}/doc` + '/n-icon' + en: 'Icon', + zh: '图标', + enSuffix: true, + path: '/n-icon' }, { - name: 'Tag', - title: '标签', - titleExtra: 'Tag', - path: `/${lang}/${theme}/doc` + '/n-tag' + en: 'Tag', + zh: '标签', + enSuffix: true, + path: '/n-tag' }, { - name: 'Typography', - title: '排印', - titleExtra: 'Typography', - path: `/${lang}/${theme}/doc` + '/n-typography' + en: 'Typography', + zh: '排印', + enSuffix: true, + path: '/n-typography' } ] }), appendCounts({ - title: '数据录入组件', - name: 'Data Input Components', + zh: '数据录入组件', + en: 'Data Input Components', type: 'group', - childItems: [ + children: [ { - name: 'Auto Complete', - title: '自动填充', - titleExtra: 'Auto Complete', - path: `/${lang}/${theme}/doc` + '/n-auto-complete' + en: 'Auto Complete', + zh: '自动填充', + enSuffix: true, + path: '/n-auto-complete' }, { - name: 'Cascader', - title: '级联选择', - titleExtra: 'Cascader', - path: `/${lang}/${theme}/doc` + '/n-cascader' + en: 'Cascader', + zh: '级联选择', + enSuffix: true, + path: '/n-cascader' }, { - name: 'Checkbox', - title: '复选框', - titleExtra: 'Checkbox', - path: `/${lang}/${theme}/doc` + '/n-checkbox' + en: 'Checkbox', + zh: '复选框', + enSuffix: true, + path: '/n-checkbox' }, { - name: 'Date Picker', - title: '日期选择器', - titleExtra: 'Date Picker', - path: `/${lang}/${theme}/doc` + '/n-date-picker' + en: 'Date Picker', + zh: '日期选择器', + enSuffix: true, + path: '/n-date-picker' }, { - name: 'Dynamic Input', - title: '动态录入', - titleExtra: 'Dynamic Input', - path: `/${lang}/${theme}/doc` + '/n-dynamic-input' + en: 'Dynamic Input', + zh: '动态录入', + enSuffix: true, + path: '/n-dynamic-input' }, { - name: 'Dynamic Tags', - title: '动态标签', - titleExtra: 'Dynamic Tags', - path: `/${lang}/${theme}/doc` + '/n-dynamic-tags' + en: 'Dynamic Tags', + zh: '动态标签', + enSuffix: true, + path: '/n-dynamic-tags' }, { - name: 'Form', - title: '表单', - titleExtra: 'Form', - path: `/${lang}/${theme}/doc` + '/n-form' + en: 'Form', + zh: '表单', + enSuffix: true, + path: '/n-form' }, { - name: 'Input', - title: '文本输入', - titleExtra: 'Input', - path: `/${lang}/${theme}/doc` + '/n-input' + en: 'Input', + zh: '文本输入', + enSuffix: true, + path: '/n-input' }, { - name: 'Input Number', - title: '数字输入', - titleExtra: 'Input Number', - path: `/${lang}/${theme}/doc` + '/n-input-number' + en: 'Input Number', + zh: '数字输入', + enSuffix: true, + path: '/n-input-number' }, { - name: 'Radio', - title: '单选', - titleExtra: 'Radio', - path: `/${lang}/${theme}/doc` + '/n-radio' + en: 'Radio', + zh: '单选', + enSuffix: true, + path: '/n-radio' }, { - name: 'Rate', - title: '评分', - titleExtra: 'Rate', - path: `/${lang}/${theme}/doc` + '/n-rate' + en: 'Rate', + zh: '评分', + enSuffix: true, + path: '/n-rate' }, { - name: 'Select', - title: '选择器', - titleExtra: 'Select', - path: `/${lang}/${theme}/doc` + '/n-select' + en: 'Select', + zh: '选择器', + enSuffix: true, + path: '/n-select' }, { - name: 'Slider', - title: '滑动选择', - titleExtra: 'Slider', - path: `/${lang}/${theme}/doc` + '/n-slider' + en: 'Slider', + zh: '滑动选择', + enSuffix: true, + path: '/n-slider' }, { - name: 'Switch', - title: '开关', - titleExtra: 'Switch', - path: `/${lang}/${theme}/doc` + '/n-switch' + en: 'Switch', + zh: '开关', + enSuffix: true, + path: '/n-switch' }, { - name: 'Time Picker', - title: '时间选择器', - titleExtra: 'Time Picker', - path: `/${lang}/${theme}/doc` + '/n-time-picker' + en: 'Time Picker', + zh: '时间选择器', + enSuffix: true, + path: '/n-time-picker' }, { - name: 'Transfer', - title: '穿梭框', - titleExtra: 'Transfer', - path: `/${lang}/${theme}/doc` + '/n-transfer' + en: 'Transfer', + zh: '穿梭框', + enSuffix: true, + path: '/n-transfer' }, { - name: 'Upload', - title: '上传', - titleExtra: 'Upload', - path: `/${lang}/${theme}/doc` + '/n-upload' + en: 'Upload', + zh: '上传', + enSuffix: true, + path: '/n-upload' } ] }), appendCounts({ - title: '数据展示组件', - name: 'Data Display Components', + zh: '数据展示组件', + en: 'Data Display Components', type: 'group', - childItems: [ + children: [ { - name: 'Code', - title: '代码', - titleExtra: 'Code', - path: `/${lang}/${theme}/doc` + '/n-code' + en: 'Code', + zh: '代码', + enSuffix: true, + path: '/n-code' }, { - name: 'Data Table', - title: '数据表格', - titleExtra: 'Data Table', - path: `/${lang}/${theme}/doc` + '/n-data-table' + en: 'Data Table', + zh: '数据表格', + enSuffix: true, + path: '/n-data-table' }, { - name: 'Descriptions', - title: '描述', - titleExtra: 'Descriptions', - path: `/${lang}/${theme}/doc` + '/n-descriptions' + en: 'Descriptions', + zh: '描述', + enSuffix: true, + path: '/n-descriptions' }, { - name: 'Empty', - title: '无内容', - titleExtra: 'Empty', - path: `/${lang}/${theme}/doc` + '/n-empty' + en: 'Empty', + zh: '无内容', + enSuffix: true, + path: '/n-empty' }, { - name: 'List', - title: '列表', - titleExtra: 'List', - path: `/${lang}/${theme}/doc` + '/n-list' + en: 'List', + zh: '列表', + enSuffix: true, + path: '/n-list' }, { - name: 'Log', - title: '日志', - titleExtra: 'Log', - path: `/${lang}/${theme}/doc` + '/n-log' + en: 'Log', + zh: '日志', + enSuffix: true, + path: '/n-log' }, { - name: 'Statistic', - title: '统计数据', - titleExtra: 'Statistic', - path: `/${lang}/${theme}/doc` + '/n-statistic' + en: 'Statistic', + zh: '统计数据', + enSuffix: true, + path: '/n-statistic' }, { - name: 'Table', - title: '表格', - titleExtra: 'Table', - path: `/${lang}/${theme}/doc` + '/n-table' + en: 'Table', + zh: '表格', + enSuffix: true, + path: '/n-table' }, { - name: 'Thing', - title: '东西', - titleExtra: 'Thing', - path: `/${lang}/${theme}/doc` + '/n-thing' + en: 'Thing', + zh: '东西', + enSuffix: true, + path: '/n-thing' }, { - name: 'Time', - title: '时间', - titleExtra: 'Time', - path: `/${lang}/${theme}/doc` + '/n-time' + en: 'Time', + zh: '时间', + enSuffix: true, + path: '/n-time' }, { - name: 'Timeline', - title: '时间线', - titleExtra: 'Timeline', - path: `/${lang}/${theme}/doc` + '/n-timeline' + en: 'Timeline', + zh: '时间线', + enSuffix: true, + path: '/n-timeline' }, { - name: 'Tree', - title: '树', - titleExtra: 'Tree', - path: `/${lang}/${theme}/doc` + '/n-tree' + en: 'Tree', + zh: '树', + enSuffix: true, + path: '/n-tree' } ] }), appendCounts({ - title: '导航组件', - name: 'Navigation Components', + zh: '导航组件', + en: 'Navigation Components', type: 'group', - childItems: [ + children: [ { - name: 'Affix', - title: '固钉', - titleExtra: 'Affix', - path: `/${lang}/${theme}/doc` + '/n-affix' + en: 'Affix', + zh: '固钉', + enSuffix: true, + path: '/n-affix' }, { - name: 'Anchor', - title: '侧边导航', - titleExtra: 'Anchor', - path: `/${lang}/${theme}/doc` + '/n-anchor' + en: 'Anchor', + zh: '侧边导航', + enSuffix: true, + path: '/n-anchor' }, { - name: 'Back Top', - title: '回到顶部', - titleExtra: 'Back Top', - path: `/${lang}/${theme}/doc` + '/n-back-top' + en: 'Back Top', + zh: '回到顶部', + enSuffix: true, + path: '/n-back-top' }, { - name: 'Breadcrumb', - title: '面包屑', - titleExtra: 'Breadcrumb', - path: `/${lang}/${theme}/doc` + '/n-breadcrumb' + en: 'Breadcrumb', + zh: '面包屑', + enSuffix: true, + path: '/n-breadcrumb' }, { - name: 'Loading Bar', - title: '加载条', - titleExtra: 'Loading Bar', - path: `/${lang}/${theme}/doc` + '/n-loading-bar' + en: 'Loading Bar', + zh: '加载条', + enSuffix: true, + path: '/n-loading-bar' }, { - name: 'Menu', - title: '菜单', - titleExtra: 'Menu', - path: `/${lang}/${theme}/doc` + '/n-menu' + en: 'Menu', + zh: '菜单', + enSuffix: true, + path: '/n-menu' }, { - name: 'Pagination', - title: '分页', - titleExtra: 'Pagination', - path: `/${lang}/${theme}/doc` + '/n-pagination' + en: 'Pagination', + zh: '分页', + enSuffix: true, + path: '/n-pagination' }, { - name: 'Steps', - title: '步骤', - titleExtra: 'Steps', - path: `/${lang}/${theme}/doc` + '/n-steps' + en: 'Steps', + zh: '步骤', + enSuffix: true, + path: '/n-steps' }, { - name: 'Tabs', - title: '标签页', - titleExtra: 'Tabs', - path: `/${lang}/${theme}/doc` + '/n-tabs' + en: 'Tabs', + zh: '标签页', + enSuffix: true, + path: '/n-tabs' } ] }), appendCounts({ - title: '反馈组件', - name: 'Feedback Components', + zh: '反馈组件', + en: 'Feedback Components', type: 'group', - childItems: [ + children: [ { - name: 'Alert', - title: '警告信息', - titleExtra: 'Alert', - path: `/${lang}/${theme}/doc` + '/n-alert' + en: 'Alert', + zh: '警告信息', + enSuffix: true, + path: '/n-alert' }, { - name: 'Badge', - title: '标记', - titleExtra: 'Badge', - path: `/${lang}/${theme}/doc` + '/n-badge' + en: 'Badge', + zh: '标记', + enSuffix: true, + path: '/n-badge' }, { - name: 'Dialog', - title: '对话框', - titleExtra: 'Dialog', - path: `/${lang}/${theme}/doc` + '/n-dialog' + en: 'Dialog', + zh: '对话框', + enSuffix: true, + path: '/n-dialog' }, { - name: 'Drawer', - title: '抽屉', - titleExtra: 'Drawer', - path: `/${lang}/${theme}/doc` + '/n-drawer' + en: 'Drawer', + zh: '抽屉', + enSuffix: true, + path: '/n-drawer' }, { - name: 'Message', - title: '信息', - titleExtra: 'Message', - path: `/${lang}/${theme}/doc` + '/n-message' + en: 'Message', + zh: '信息', + enSuffix: true, + path: '/n-message' }, { - name: 'Modal', - title: '模态框', - titleExtra: 'Modal', - path: `/${lang}/${theme}/doc` + '/n-modal' + en: 'Modal', + zh: '模态框', + enSuffix: true, + path: '/n-modal' }, { - name: 'Notification', - title: '通知', - titleExtra: 'Notification', - path: `/${lang}/${theme}/doc` + '/n-notification' + en: 'Notification', + zh: '通知', + enSuffix: true, + path: '/n-notification' }, { - name: 'Popconfirm', - title: '弹出确认', - titleExtra: 'Popconfirm', - path: `/${lang}/${theme}/doc` + '/n-popconfirm' + en: 'Popconfirm', + zh: '弹出确认', + enSuffix: true, + path: '/n-popconfirm' }, { - name: 'Popover', - title: '弹出信息', - titleExtra: 'Popover', - path: `/${lang}/${theme}/doc` + '/n-popover' + en: 'Popover', + zh: '弹出信息', + enSuffix: true, + path: '/n-popover' }, { - name: 'Popselect', - title: '弹出选择', - titleExtra: 'Popselect', - path: `/${lang}/${theme}/doc` + '/n-popselect' + en: 'Popselect', + zh: '弹出选择', + enSuffix: true, + path: '/n-popselect' }, { - name: 'Progress', - title: '进度', - titleExtra: 'Progress', - path: `/${lang}/${theme}/doc` + '/n-progress' + en: 'Progress', + zh: '进度', + enSuffix: true, + path: '/n-progress' }, { - name: 'Result', - title: '结果页', - titleExtra: 'Result', - path: `/${lang}/${theme}/doc` + '/n-result' + en: 'Result', + zh: '结果页', + enSuffix: true, + path: '/n-result' }, { - name: 'Spin', - title: '加载', - titleExtra: 'Spin', - path: `/${lang}/${theme}/doc` + '/n-spin' + en: 'Spin', + zh: '加载', + enSuffix: true, + path: '/n-spin' }, { - name: 'Tooltip', - title: '弹出提示', - titleExtra: 'Tooltip', - path: `/${lang}/${theme}/doc` + '/n-tooltip' + en: 'Tooltip', + zh: '弹出提示', + enSuffix: true, + path: '/n-tooltip' } ] }), ...createDeprecatedDemos( { - name: 'Deprecated', - childItems: [ + en: 'Deprecated', + children: [ { - name: 'Nimbus Service Layout', - path: `/${lang}/${theme}/doc` + '/n-nimbus-service-layout' + en: 'Nimbus Service Layout', + path: '/n-nimbus-service-layout' } ] }, @@ -538,55 +548,55 @@ export default function (instance) { ), ...createDebugDemos( { - name: 'Debug', - childItems: [ + en: 'Debug', + children: [ { - name: 'SuffixDebug', - path: `/${lang}/${theme}/doc` + '/n-base-suffix-debug' + en: 'SuffixDebug', + path: '/n-base-suffix-debug' }, { - name: 'PopoverDebug', + en: 'PopoverDebug', path: '/n-popover-debug' }, { - name: 'RouterDebug', - path: `/${lang}/${theme}/doc` + '/n-router-debug' + en: 'RouterDebug', + path: '/n-router-debug' }, { - name: 'ModalDebug', - path: `/${lang}/${theme}/doc` + '/n-modal-debug' + en: 'ModalDebug', + path: '/n-modal-debug' }, { - name: 'ScrollbarDebug', - path: `/${lang}/${theme}/doc` + '/n-scrollbar-debug' + en: 'ScrollbarDebug', + path: '/n-scrollbar-debug' }, { - name: 'ScrollbarDebug2', - path: `/${lang}/${theme}/doc` + '/n-scrollbar-debug2' + en: 'ScrollbarDebug2', + path: '/n-scrollbar-debug2' }, { - name: 'DatePickerDebug', - path: `/${lang}/${theme}/doc` + '/n-date-picker-debug' + en: 'DatePickerDebug', + path: '/n-date-picker-debug' }, { - name: 'BackTopDebug', + en: 'BackTopDebug', path: '/n-back-top-debug' }, { - name: 'CascaderDebug', + en: 'CascaderDebug', path: '/n-cascader-debug' }, { - name: 'VerticalAlignDebug', - path: `/${lang}/${theme}/doc` + '/n-vertical-align-debug' + en: 'VerticalAlignDebug', + path: '/n-vertical-align-debug' }, { - name: 'IconTransitionDebug', - path: `/${lang}/${theme}/doc` + '/n-icon-transition-debug' + en: 'IconTransitionDebug', + path: '/n-icon-transition-debug' }, { - name: 'SelectDebug', - path: `/${lang}/${theme}/doc` + '/n-select-debug' + en: 'SelectDebug', + path: '/n-select-debug' } ] }, diff --git a/demo/utils/ComponentDocumentation.vue b/demo/utils/ComponentDocumentation.vue index 331673d59..63be322c0 100644 --- a/demo/utils/ComponentDocumentation.vue +++ b/demo/utils/ComponentDocumentation.vue @@ -4,33 +4,6 @@ - -