diff --git a/src/components/common/DarkModeSwitch.vue b/src/components/common/DarkModeSwitch.vue index 276555c..acd3ff6 100644 --- a/src/components/common/DarkModeSwitch.vue +++ b/src/components/common/DarkModeSwitch.vue @@ -1,7 +1,9 @@ diff --git a/src/layouts/components/tab/TabBar.vue b/src/layouts/components/tab/TabBar.vue index 76e537f..4753fe7 100644 --- a/src/layouts/components/tab/TabBar.vue +++ b/src/layouts/components/tab/TabBar.vue @@ -2,8 +2,13 @@ import type { RouteLocationNormalized } from 'vue-router' import Reload from './Reload.vue' import DropTabs from './DropTabs.vue' -import { renderIcon } from '@/utils' import { useAppStore, useTabStore } from '@/store' +import IconRedo from '~icons/icon-park-outline/redo' +import IconClose from '~icons/icon-park-outline/close' +import IconDelete from '~icons/icon-park-outline/delete-four' +import IconLeft from '~icons/icon-park-outline/to-left' +import IconRight from '~icons/icon-park-outline/to-right' +import IconFullwith from '~icons/icon-park-outline/fullwidth' const tabStore = useTabStore() const appStore = useAppStore() @@ -21,32 +26,32 @@ const options = computed(() => { { label: t('common.reload'), key: 'reload', - icon: renderIcon('icon-park-outline:redo'), + icon: () => h(IconRedo), }, { label: t('common.close'), key: 'closeCurrent', - icon: renderIcon('icon-park-outline:close'), + icon: () => h(IconClose), }, { label: t('app.closeOther'), key: 'closeOther', - icon: renderIcon('icon-park-outline:delete-four'), + icon: () => h(IconDelete), }, { label: t('app.closeLeft'), key: 'closeLeft', - icon: renderIcon('icon-park-outline:to-left'), + icon: () => h(IconLeft), }, { label: t('app.closeRight'), key: 'closeRight', - icon: renderIcon('icon-park-outline:to-right'), + icon: () => h(IconRight), }, { label: t('app.closeAll'), key: 'closeAll', - icon: renderIcon('icon-park-outline:fullwidth'), + icon: () => h(IconFullwith), }, ] }) diff --git a/src/typings/global.d.ts b/src/typings/global.d.ts index 1315306..96982e2 100644 --- a/src/typings/global.d.ts +++ b/src/typings/global.d.ts @@ -19,13 +19,6 @@ declare namespace NaiveUI { type ThemeColor = 'default' | 'error' | 'primary' | 'info' | 'success' | 'warning' } -declare module '~icons/*' { - import type { FunctionalComponent, SVGAttributes } from 'vue' - - const component: FunctionalComponent - export default component -} - declare namespace Storage { interface Session { demoKey: string diff --git a/tsconfig.json b/tsconfig.json index 3e280eb..9725c26 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,7 +10,7 @@ "@/*": ["src/*"] }, "resolveJsonModule": true, - "types": ["node", "vite/client", "naive-ui/volar"], + "types": ["node", "vite/client", "naive-ui/volar", "unplugin-icons/types/vue"], "allowJs": true, "strict": true, "strictNullChecks": true,