From ca80a6fab8c427d1926cdf576cd103e18afa1934 Mon Sep 17 00:00:00 2001 From: Utopia Date: Tue, 2 Dec 2025 09:19:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20wot-design-uni=20=E5=9F=BA=E4=BA=8E=20vi?= =?UTF-8?q?te=20=E9=85=8D=E7=BD=AE=E8=87=AA=E5=8A=A8=E5=BC=95=E5=85=A5?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=97=B6=EF=BC=8C=E6=97=A0=E6=B3=95=E6=AD=A3?= =?UTF-8?q?=E5=B8=B8=E5=BC=95=E5=85=A5=20(#360)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vite.config.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index 7a8a2a9..5581195 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -91,6 +91,13 @@ export default defineConfig(({ command, mode }) => { UniKuRoot({ excludePages: ['**/components/**/**.*'], }), + // Components 需要在 Uni 之前引入 + Components({ + extensions: ['vue'], + deep: true, // 是否递归扫描子目录, + directoryAsNamespace: false, // 是否把目录名作为命名空间前缀,true 时组件名为 目录名+组件名, + dts: 'src/types/components.d.ts', // 自动生成的组件类型声明文件路径(用于 TypeScript 支持) + }), Uni(), { // 临时解决 dcloudio 官方的 @dcloudio/uni-mp-compiler 出现的编译 BUG @@ -139,12 +146,6 @@ export default defineConfig(({ command, mode }) => { }, ), syncManifestPlugin(), - Components({ - extensions: ['vue'], - deep: true, // 是否递归扫描子目录, - directoryAsNamespace: false, // 是否把目录名作为命名空间前缀,true 时组件名为 目录名+组件名, - dts: 'src/types/components.d.ts', // 自动生成的组件类型声明文件路径(用于 TypeScript 支持) - }), // 自动打开开发者工具插件 (必须修改 .env 文件中的 VITE_WX_APPID) openDevTools(), ],