diff --git a/src/components/WechatModal.vue b/src/components/WechatModal.vue index 181f8a6..a1845e3 100644 --- a/src/components/WechatModal.vue +++ b/src/components/WechatModal.vue @@ -12,12 +12,16 @@ const props = defineProps({ type: String, required: true, validator: value => { - if (!value) return false + // 允许空值用于初始化状态 + if (!value) return true + // 扩展支持的路径格式 return ( - value.startsWith('/') || + value.startsWith('/') || value.startsWith('http') || value.startsWith('data:image') || - value.startsWith('@/') + value.startsWith('@/') || + value.startsWith('src/') || // 添加 src/ 路径支持 + value.includes('base64') // 允许包含 base64 的字符串 ) } },