From b8b7f4d742bc7deb72ce8ea7e1baec1bce52b2b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E5=AF=B8=E7=81=B0?= Date: Wed, 8 Jan 2025 18:09:13 +0800 Subject: [PATCH] fix(projects): :bug: fix element-plus style conflicts (#49) --- build/plugins/unplugin.ts | 6 +++++- src/typings/components.d.ts | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/build/plugins/unplugin.ts b/build/plugins/unplugin.ts index 8ad80ee..652f400 100644 --- a/build/plugins/unplugin.ts +++ b/build/plugins/unplugin.ts @@ -31,7 +31,11 @@ export function setupUnplugin(viteEnv: Env.ImportMeta) { dts: 'src/typings/components.d.ts', types: [{ from: 'vue-router', names: ['RouterLink', 'RouterView'] }], resolvers: [ - ElementPlusResolver(), // auto import Element Plus components。 full import to see /src/plugins/ui.ts + // auto import Element Plus components。 full import to see /src/plugins/ui.ts + ElementPlusResolver({ + // no to import style, full import to see /src/plugins/assets.ts + importStyle: false + }), IconsResolver({ customCollections: [collectionName], componentPrefix: VITE_ICON_PREFIX }) ] }), diff --git a/src/typings/components.d.ts b/src/typings/components.d.ts index 9b09017..84fc18d 100644 --- a/src/typings/components.d.ts +++ b/src/typings/components.d.ts @@ -47,12 +47,15 @@ declare module 'vue' { ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] ElSelect: typeof import('element-plus/es')['ElSelect'] ElSpace: typeof import('element-plus/es')['ElSpace'] + ElStatistic: typeof import('element-plus/es')['ElStatistic'] ElSubMenu: typeof import('element-plus/es')['ElSubMenu'] ElSwitch: typeof import('element-plus/es')['ElSwitch'] ElTable: typeof import('element-plus/es')['ElTable'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] ElTabPane: typeof import('element-plus/es')['ElTabPane'] ElTabs: typeof import('element-plus/es')['ElTabs'] + ElTimeline: typeof import('element-plus/es')['ElTimeline'] + ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElTree: typeof import('element-plus/es')['ElTree'] ElWatermark: typeof import('element-plus/es')['ElWatermark']