From 8f6bf6add3bc0f28df3f2269cbdb2f32fa72470d Mon Sep 17 00:00:00 2001 From: Li Kui <90845831+likui628@users.noreply.github.com> Date: Wed, 11 Sep 2024 16:23:24 +0800 Subject: [PATCH] perf: update menu icons (#4357) --- .../src/router/routes/modules/dashboard.ts | 1 + .../src/router/routes/modules/vben.ts | 2 ++ .../src/router/routes/modules/dashboard.ts | 1 + .../web-ele/src/router/routes/modules/vben.ts | 3 ++ .../src/router/routes/modules/dashboard.ts | 1 + .../src/router/routes/modules/vben.ts | 3 ++ .../menu-ui/src/components/menu-item.vue | 2 +- .../breadcrumb/breadcrumb-background.vue | 1 - .../src/components/breadcrumb/breadcrumb.vue | 9 +----- .../src/components/tabs-chrome/tabs.vue | 1 - packages/icons/src/svg/icons/antdv-logo.svg | 29 +++++++++++++++++++ packages/icons/src/svg/index.ts | 2 ++ .../src/router/routes/modules/dashboard.ts | 1 + .../src/router/routes/modules/examples.ts | 5 ++++ playground/src/router/routes/modules/vben.ts | 4 +++ 15 files changed, 54 insertions(+), 11 deletions(-) create mode 100644 packages/icons/src/svg/icons/antdv-logo.svg diff --git a/apps/web-antd/src/router/routes/modules/dashboard.ts b/apps/web-antd/src/router/routes/modules/dashboard.ts index a8cdb05da08..1bddab9dbba 100644 --- a/apps/web-antd/src/router/routes/modules/dashboard.ts +++ b/apps/web-antd/src/router/routes/modules/dashboard.ts @@ -29,6 +29,7 @@ const routes: RouteRecordRaw[] = [ path: '/workspace', component: () => import('#/views/dashboard/workspace/index.vue'), meta: { + icon: 'carbon:workspace', title: $t('page.dashboard.workspace'), }, }, diff --git a/apps/web-antd/src/router/routes/modules/vben.ts b/apps/web-antd/src/router/routes/modules/vben.ts index f1a836fb414..4694721283b 100644 --- a/apps/web-antd/src/router/routes/modules/vben.ts +++ b/apps/web-antd/src/router/routes/modules/vben.ts @@ -58,6 +58,7 @@ const routes: RouteRecordRaw[] = [ component: IFrameView, meta: { badgeType: 'dot', + icon: 'logos:naiveui', link: VBEN_NAIVE_PREVIEW_URL, title: $t('page.vben.naive-ui'), }, @@ -68,6 +69,7 @@ const routes: RouteRecordRaw[] = [ component: IFrameView, meta: { badgeType: 'dot', + icon: 'logos:element', link: VBEN_ELE_PREVIEW_URL, title: $t('page.vben.element-plus'), }, diff --git a/apps/web-ele/src/router/routes/modules/dashboard.ts b/apps/web-ele/src/router/routes/modules/dashboard.ts index a8cdb05da08..1bddab9dbba 100644 --- a/apps/web-ele/src/router/routes/modules/dashboard.ts +++ b/apps/web-ele/src/router/routes/modules/dashboard.ts @@ -29,6 +29,7 @@ const routes: RouteRecordRaw[] = [ path: '/workspace', component: () => import('#/views/dashboard/workspace/index.vue'), meta: { + icon: 'carbon:workspace', title: $t('page.dashboard.workspace'), }, }, diff --git a/apps/web-ele/src/router/routes/modules/vben.ts b/apps/web-ele/src/router/routes/modules/vben.ts index fab1905d98e..6cd3588a374 100644 --- a/apps/web-ele/src/router/routes/modules/vben.ts +++ b/apps/web-ele/src/router/routes/modules/vben.ts @@ -7,6 +7,7 @@ import { VBEN_LOGO_URL, VBEN_NAIVE_PREVIEW_URL, } from '@vben/constants'; +import { SvgAntdvLogoIcon } from '@vben/icons'; import { BasicLayout, IFrameView } from '#/layouts'; import { $t } from '#/locales'; @@ -58,6 +59,7 @@ const routes: RouteRecordRaw[] = [ component: IFrameView, meta: { badgeType: 'dot', + icon: 'logos:naiveui', link: VBEN_NAIVE_PREVIEW_URL, title: $t('page.vben.naive-ui'), }, @@ -68,6 +70,7 @@ const routes: RouteRecordRaw[] = [ component: IFrameView, meta: { badgeType: 'dot', + icon: SvgAntdvLogoIcon, link: VBEN_ANT_PREVIEW_URL, title: $t('page.vben.antdv'), }, diff --git a/apps/web-naive/src/router/routes/modules/dashboard.ts b/apps/web-naive/src/router/routes/modules/dashboard.ts index a8cdb05da08..1bddab9dbba 100644 --- a/apps/web-naive/src/router/routes/modules/dashboard.ts +++ b/apps/web-naive/src/router/routes/modules/dashboard.ts @@ -29,6 +29,7 @@ const routes: RouteRecordRaw[] = [ path: '/workspace', component: () => import('#/views/dashboard/workspace/index.vue'), meta: { + icon: 'carbon:workspace', title: $t('page.dashboard.workspace'), }, }, diff --git a/apps/web-naive/src/router/routes/modules/vben.ts b/apps/web-naive/src/router/routes/modules/vben.ts index 4f067498e00..01041bf45a6 100644 --- a/apps/web-naive/src/router/routes/modules/vben.ts +++ b/apps/web-naive/src/router/routes/modules/vben.ts @@ -7,6 +7,7 @@ import { VBEN_GITHUB_URL, VBEN_LOGO_URL, } from '@vben/constants'; +import { SvgAntdvLogoIcon } from '@vben/icons'; import { BasicLayout, IFrameView } from '#/layouts'; import { $t } from '#/locales'; @@ -58,6 +59,7 @@ const routes: RouteRecordRaw[] = [ component: IFrameView, meta: { badgeType: 'dot', + icon: SvgAntdvLogoIcon, link: VBEN_ANT_PREVIEW_URL, title: $t('page.vben.antdv'), }, @@ -68,6 +70,7 @@ const routes: RouteRecordRaw[] = [ component: IFrameView, meta: { badgeType: 'dot', + icon: 'logos:element', link: VBEN_ELE_PREVIEW_URL, title: $t('page.vben.element-plus'), }, diff --git a/packages/@core/ui-kit/menu-ui/src/components/menu-item.vue b/packages/@core/ui-kit/menu-ui/src/components/menu-item.vue index 9b44e06c5a0..53152661834 100644 --- a/packages/@core/ui-kit/menu-ui/src/components/menu-item.vue +++ b/packages/@core/ui-kit/menu-ui/src/components/menu-item.vue @@ -113,7 +113,7 @@ onBeforeUnmount(() => { class="right-2" v-bind="props" /> - + diff --git a/packages/@core/ui-kit/shadcn-ui/src/components/breadcrumb/breadcrumb-background.vue b/packages/@core/ui-kit/shadcn-ui/src/components/breadcrumb/breadcrumb-background.vue index a85ecac84c1..2d38e0a7df8 100644 --- a/packages/@core/ui-kit/shadcn-ui/src/components/breadcrumb/breadcrumb-background.vue +++ b/packages/@core/ui-kit/shadcn-ui/src/components/breadcrumb/breadcrumb-background.vue @@ -31,7 +31,6 @@ function handleClick(path?: string) { diff --git a/packages/@core/ui-kit/shadcn-ui/src/components/breadcrumb/breadcrumb.vue b/packages/@core/ui-kit/shadcn-ui/src/components/breadcrumb/breadcrumb.vue index c7c00bef5a3..7d256202b15 100644 --- a/packages/@core/ui-kit/shadcn-ui/src/components/breadcrumb/breadcrumb.vue +++ b/packages/@core/ui-kit/shadcn-ui/src/components/breadcrumb/breadcrumb.vue @@ -47,12 +47,7 @@ function handleClick(path?: string) {
- + {{ item.title }} @@ -77,7 +72,6 @@ function handleClick(path?: string) { @@ -89,7 +83,6 @@ function handleClick(path?: string) { diff --git a/packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue b/packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue index fc43310f541..9f322e23ba0 100644 --- a/packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue +++ b/packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue @@ -134,7 +134,6 @@ const tabsView = computed((): TabConfig[] => { v-if="showIcon" :icon="tab.icon" class="mr-1 flex size-4 items-center overflow-hidden" - fallback /> diff --git a/packages/icons/src/svg/icons/antdv-logo.svg b/packages/icons/src/svg/icons/antdv-logo.svg new file mode 100644 index 00000000000..dbfcee7e558 --- /dev/null +++ b/packages/icons/src/svg/icons/antdv-logo.svg @@ -0,0 +1,29 @@ + + + + Vue + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/icons/src/svg/index.ts b/packages/icons/src/svg/index.ts index 27d2780e601..a4a53ddfddd 100644 --- a/packages/icons/src/svg/index.ts +++ b/packages/icons/src/svg/index.ts @@ -10,8 +10,10 @@ const SvgDownloadIcon = createIconifyIcon('svg:download'); const SvgCardIcon = createIconifyIcon('svg:card'); const SvgBellIcon = createIconifyIcon('svg:bell'); const SvgCakeIcon = createIconifyIcon('svg:cake'); +const SvgAntdvLogoIcon = createIconifyIcon('svg:antdv-logo'); export { + SvgAntdvLogoIcon, SvgAvatar1Icon, SvgAvatar2Icon, SvgAvatar3Icon, diff --git a/playground/src/router/routes/modules/dashboard.ts b/playground/src/router/routes/modules/dashboard.ts index a8cdb05da08..1bddab9dbba 100644 --- a/playground/src/router/routes/modules/dashboard.ts +++ b/playground/src/router/routes/modules/dashboard.ts @@ -29,6 +29,7 @@ const routes: RouteRecordRaw[] = [ path: '/workspace', component: () => import('#/views/dashboard/workspace/index.vue'), meta: { + icon: 'carbon:workspace', title: $t('page.dashboard.workspace'), }, }, diff --git a/playground/src/router/routes/modules/examples.ts b/playground/src/router/routes/modules/examples.ts index b2b6a9c7912..c946e79c2bc 100644 --- a/playground/src/router/routes/modules/examples.ts +++ b/playground/src/router/routes/modules/examples.ts @@ -20,6 +20,7 @@ const routes: RouteRecordRaw[] = [ path: '/examples/modal', component: () => import('#/views/examples/modal/index.vue'), meta: { + icon: 'system-uicons:window-content', title: $t('page.examples.modal.title'), }, }, @@ -28,6 +29,7 @@ const routes: RouteRecordRaw[] = [ path: '/examples/drawer', component: () => import('#/views/examples/drawer/index.vue'), meta: { + icon: 'iconoir:drawer', title: $t('page.examples.drawer.title'), }, }, @@ -36,6 +38,7 @@ const routes: RouteRecordRaw[] = [ path: '/examples/ellipsis', component: () => import('#/views/examples/ellipsis/index.vue'), meta: { + icon: 'ion:ellipsis-horizontal', title: $t('page.examples.ellipsis.title'), }, }, @@ -44,6 +47,7 @@ const routes: RouteRecordRaw[] = [ path: '/examples/captcha', component: () => import('#/views/examples/captcha/index.vue'), meta: { + icon: 'logos:recaptcha', title: $t('page.examples.captcha.title'), }, }, @@ -51,6 +55,7 @@ const routes: RouteRecordRaw[] = [ name: 'FormExample', path: '/examples/form', meta: { + icon: 'mdi:form-select', title: $t('page.examples.form.title'), }, children: [ diff --git a/playground/src/router/routes/modules/vben.ts b/playground/src/router/routes/modules/vben.ts index 1519a4a2c11..baf247568a6 100644 --- a/playground/src/router/routes/modules/vben.ts +++ b/playground/src/router/routes/modules/vben.ts @@ -8,6 +8,7 @@ import { VBEN_LOGO_URL, VBEN_NAIVE_PREVIEW_URL, } from '@vben/constants'; +import { SvgAntdvLogoIcon } from '@vben/icons'; import { BasicLayout, IFrameView } from '#/layouts'; import { $t } from '#/locales'; @@ -59,6 +60,7 @@ const routes: RouteRecordRaw[] = [ component: IFrameView, meta: { badgeType: 'dot', + icon: SvgAntdvLogoIcon, link: VBEN_ANT_PREVIEW_URL, title: $t('page.vben.antdv'), }, @@ -69,6 +71,7 @@ const routes: RouteRecordRaw[] = [ component: IFrameView, meta: { badgeType: 'dot', + icon: 'logos:naiveui', link: VBEN_NAIVE_PREVIEW_URL, title: $t('page.vben.naive-ui'), }, @@ -79,6 +82,7 @@ const routes: RouteRecordRaw[] = [ component: IFrameView, meta: { badgeType: 'dot', + icon: 'logos:element', link: VBEN_ELE_PREVIEW_URL, title: $t('page.vben.element-plus'), },