fix(mini-program): 修复 logo.svg 500 错误和编译问题
问题: - 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 图片
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
<view class="header" :style="{ paddingTop: safeAreaTop + 20 + 'px' }">
|
||||
<view class="header-left">
|
||||
<view class="logo-box">
|
||||
<image class="logo" src="/logo.svg" mode="aspectFit" />
|
||||
<image class="logo" src="/static/logo.svg" mode="aspectFit" />
|
||||
</view>
|
||||
<view class="brand">
|
||||
<text class="brand-title font-serif">人生 OS</text>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<view class="overlay">
|
||||
<view class="status-bar-space" :style="{ height: statusBarHeight + 'px' }"></view>
|
||||
<view class="content-area" :style="{ paddingBottom: safeAreaBottom + 'px' }">
|
||||
<image class="logo" src="/logo.svg" mode="widthFix"></image>
|
||||
<image class="logo" src="/static/logo.svg" mode="widthFix"></image>
|
||||
<text class="app-name font-serif">人生OS</text>
|
||||
<text class="app-version">LIFE HARMONY v3.1</text>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user