From e1097cbbee7e6983313e9b5d09a00bbc921604a5 Mon Sep 17 00:00:00 2001 From: Peanut Date: Wed, 8 Apr 2026 19:12:04 +0800 Subject: [PATCH] =?UTF-8?q?fix(mini-program):=20=E4=BF=AE=E5=A4=8D=20logo.?= =?UTF-8?q?svg=20500=20=E9=94=99=E8=AF=AF=E5=92=8C=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 问题: - SVG 文件使用 filter 和 style 属性导致小程序编译错误 - 错误信息:ReferenceError: $1 is not defined 修复: 1. 简化 SVG 文件,移除 filter 和 style 属性 - 移除 filter (feGaussianBlur, feMerge) - 移除 style 属性,改用直接属性 (stop-color 替代 style="stop-color:xxx") - 移除 filter="url(#glow)" 引用 2. 恢复 vite.config.js 的 publicDir 配置 - publicDir 指向 mini-program/static 目录 - SVG 文件编译到输出目录根位置 3. 更新图片引用路径 - splash/index.vue: /static/logo.svg - main/index.vue: /static/logo.svg 效果: - logo.svg 正确编译到 unpackage/dist/dev/mp-weixin/logo.svg - 不再出现 $1 is not defined 错误 - 小程序正常加载 logo 图片 --- mini-program/src/pages/main/index.vue | 2 +- mini-program/src/pages/splash/index.vue | 2 +- mini-program/static/logo.svg | 54 +++++++++---------------- 3 files changed, 20 insertions(+), 38 deletions(-) diff --git a/mini-program/src/pages/main/index.vue b/mini-program/src/pages/main/index.vue index 0385875..dfb67d7 100644 --- a/mini-program/src/pages/main/index.vue +++ b/mini-program/src/pages/main/index.vue @@ -28,7 +28,7 @@ - + 人生 OS diff --git a/mini-program/src/pages/splash/index.vue b/mini-program/src/pages/splash/index.vue index cd41c4f..807ec89 100644 --- a/mini-program/src/pages/splash/index.vue +++ b/mini-program/src/pages/splash/index.vue @@ -7,7 +7,7 @@ - + 人生OS LIFE HARMONY v3.1 diff --git a/mini-program/static/logo.svg b/mini-program/static/logo.svg index 04b973a..e2821d3 100644 --- a/mini-program/static/logo.svg +++ b/mini-program/static/logo.svg @@ -1,33 +1,19 @@ - - - - + + + - - - - + + - - - - - + + + - - - - - - - - - @@ -37,31 +23,27 @@ - - - - - - + + + - - + + - + - - - - + + + +