From 1c9525a0136415ceda0f3d1a4d1c32b4fe00dcf7 Mon Sep 17 00:00:00 2001 From: Li Kui <90845831+likui628@users.noreply.github.com> Date: Wed, 31 Jul 2024 21:48:37 +0800 Subject: [PATCH] chore(@vben/web-naive): Import on demand --- apps/web-naive/src/app.vue | 3 +++ apps/web-naive/src/bootstrap.ts | 4 ---- apps/web-naive/src/router/routes/modules/demos.ts | 3 +-- website/src/guide/essentials/development.md | 6 ++++++ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/apps/web-naive/src/app.vue b/apps/web-naive/src/app.vue index 76e82a05..93ee5f51 100644 --- a/apps/web-naive/src/app.vue +++ b/apps/web-naive/src/app.vue @@ -11,6 +11,9 @@ import { enUS, GlobalThemeOverrides, lightTheme, + NConfigProvider, + NMessageProvider, + NNotificationProvider, zhCN, } from 'naive-ui'; diff --git a/apps/web-naive/src/bootstrap.ts b/apps/web-naive/src/bootstrap.ts index 850b5658..1be9bbe0 100644 --- a/apps/web-naive/src/bootstrap.ts +++ b/apps/web-naive/src/bootstrap.ts @@ -5,8 +5,6 @@ import { initStores } from '@vben/stores'; import '@vben/styles'; import '@vben/styles/antd'; -import naive from 'naive-ui'; - import { setupI18n } from '#/locales'; import App from './app.vue'; @@ -27,8 +25,6 @@ async function bootstrap(namespace: string) { // 配置路由及路由守卫 app.use(router); - app.use(naive); - app.mount('#app'); } diff --git a/apps/web-naive/src/router/routes/modules/demos.ts b/apps/web-naive/src/router/routes/modules/demos.ts index a418887a..54ee5baa 100644 --- a/apps/web-naive/src/router/routes/modules/demos.ts +++ b/apps/web-naive/src/router/routes/modules/demos.ts @@ -15,14 +15,13 @@ const routes: RouteRecordRaw[] = [ name: 'Demos', path: '/demos', children: [ - // 权限控制 { meta: { icon: 'mdi:shield-key-outline', title: $t('page.demos.naive'), }, name: 'NaiveDemos', - path: '/demos/access', + path: '/demos/naive', component: () => import('#/views/demos/naive/index.vue'), }, ], diff --git a/website/src/guide/essentials/development.md b/website/src/guide/essentials/development.md index c255aeb2..c0763b66 100644 --- a/website/src/guide/essentials/development.md +++ b/website/src/guide/essentials/development.md @@ -129,6 +129,12 @@ pnpm dev:antd pnpm dev:naive ``` +运行 `web-ele` 应用: + +```bash +pnpm dev:ele +``` + 运行 `website` 应用: ```bash