feat: enhance WechatModal component functionality

This commit is contained in:
Cat Tom
2025-03-26 03:27:33 +08:00
parent 68b5b730bd
commit 1840901294

View File

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