From 17e2cb23e7720ef1ba90d17456efae338eee4c4c Mon Sep 17 00:00:00 2001
From: ZZJ <10913410+zzj2100@user.noreply.gitee.com>
Date: 星期五, 02 九月 2022 03:28:07 +0800
Subject: [PATCH] 添加点位变更页面
---
src/components/subComponents/ImageShow.vue | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/src/components/subComponents/ImageShow.vue b/src/components/subComponents/ImageShow.vue
index 5aac2f0..a0484a7 100644
--- a/src/components/subComponents/ImageShow.vue
+++ b/src/components/subComponents/ImageShow.vue
@@ -1,5 +1,5 @@
<template>
- <img class="a111" :src="url" alt="" />
+ <img class="a111" @error="onError" :src="url" alt="" />
</template>
<script>
@@ -12,7 +12,8 @@
if (
this.src &&
this.src.indexOf("http://apps.smartai.com/httpImage/") === -1 &&
- this.src.indexOf("/images") !== 0
+ this.src.indexOf("/images") !== 0 &&
+ this.src.indexOf("/files") !== 0
) {
return "/httpImage/" + this.src;
} else {
@@ -20,6 +21,21 @@
}
},
},
+ data() {
+ return {
+ errorNum: 0,
+ };
+ },
+ methods: {
+ onError(err) {
+ console.log(err);
+ if (this.errorNum > 5) {
+ return;
+ }
+ err.target.src = this.url + "?" + Math.random();
+ this.errorNum++;
+ },
+ },
};
</script>
--
Gitblit v1.8.0