From c7fa74116c7448d9b1e24b16af2630a79155cb43 Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期日, 30 十月 2022 11:55:15 +0800 Subject: [PATCH] 新增返回警告消息提示 --- src/components/ImagePreview/index.vue | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/src/components/ImagePreview/index.vue b/src/components/ImagePreview/index.vue index cd6a157..26380bb 100644 --- a/src/components/ImagePreview/index.vue +++ b/src/components/ImagePreview/index.vue @@ -20,7 +20,7 @@ const props = defineProps({ src: { type: String, - required: true + default: "" }, width: { type: [Number, String], @@ -33,6 +33,9 @@ }); const realSrc = computed(() => { + if (!props.src) { + return; + } let real_src = props.src.split(",")[0]; if (isExternal(real_src)) { return real_src; @@ -41,6 +44,9 @@ }); const realSrcList = computed(() => { + if (!props.src) { + return; + } let real_src_list = props.src.split(","); let srcList = []; real_src_list.forEach(item => { -- Gitblit v1.9.3