From 1840901294962198d8c04b5512067e82b9abca03 Mon Sep 17 00:00:00 2001 From: Cat Tom Date: Wed, 26 Mar 2025 03:27:33 +0800 Subject: [PATCH] feat: enhance WechatModal component functionality --- src/components/WechatModal.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 的字符串 ) } },