From 851dc54b49ca0f35e01df84f1ac5b965862514a9 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 15 Aug 2022 12:07:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=BE=E7=89=87=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E7=BB=84=E4=BB=B6src=E5=B1=9E=E6=80=A7=E4=B8=BAnull?= =?UTF-8?q?=E5=80=BC=E6=8E=A7=E5=88=B6=E5=8F=B0=E6=8A=A5=E9=94=99=E9=97=AE?= =?UTF-8?q?=E9=A2=98(I5KBAS)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/components/ImagePreview/index.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ruoyi-ui/src/components/ImagePreview/index.vue b/ruoyi-ui/src/components/ImagePreview/index.vue index 743d8d51..3c770c70 100644 --- a/ruoyi-ui/src/components/ImagePreview/index.vue +++ b/ruoyi-ui/src/components/ImagePreview/index.vue @@ -19,7 +19,7 @@ export default { props: { src: { type: String, - required: true + default: "" }, width: { type: [Number, String], @@ -32,6 +32,9 @@ export default { }, computed: { realSrc() { + if (!this.src) { + return; + } let real_src = this.src.split(",")[0]; if (isExternal(real_src)) { return real_src; @@ -39,6 +42,9 @@ export default { return process.env.VUE_APP_BASE_API + real_src; }, realSrcList() { + if (!this.src) { + return; + } let real_src_list = this.src.split(","); let srcList = []; real_src_list.forEach(item => {