From d387848d15a40fb16c8a6eefb007d5f7411c5dbc Mon Sep 17 00:00:00 2001 From: ZhangXianQiang <1135831638@qq.com> Date: 星期日, 28 四月 2024 13:32:27 +0800 Subject: [PATCH] fix:修改图片浏览组件 --- src/views/system/contract/index.vue | 2 +- src/components/ImagePreview/index.vue | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/ImagePreview/index.vue b/src/components/ImagePreview/index.vue index 3c770c7..f00a0d0 100644 --- a/src/components/ImagePreview/index.vue +++ b/src/components/ImagePreview/index.vue @@ -13,7 +13,7 @@ <script> import { isExternal } from "@/utils/validate"; - +const DEFAULT_IMAGE = 'https://img2.baidu.com/it/u=68398439,1553004927&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=357'; export default { name: "ImagePreview", props: { @@ -33,7 +33,7 @@ computed: { realSrc() { if (!this.src) { - return; + return DEFAULT_IMAGE; } let real_src = this.src.split(",")[0]; if (isExternal(real_src)) { @@ -43,7 +43,7 @@ }, realSrcList() { if (!this.src) { - return; + return [DEFAULT_IMAGE]; } let real_src_list = this.src.split(","); let srcList = []; diff --git a/src/views/system/contract/index.vue b/src/views/system/contract/index.vue index b1da0d2..61ac223 100644 --- a/src/views/system/contract/index.vue +++ b/src/views/system/contract/index.vue @@ -4,7 +4,7 @@ <el-row v-loading="loading"> <el-col :span="8" v-for="(item, index) in contractList" :key="index" style="margin: 10px;width: 30%;"> <el-card :body-style="{ padding: '0px' }"> - <ImagePreview style="width: 420px;height: 187px;" + <ImagePreview style="width: 100%;height: 187px;" fit="cover" :src="item.attachment" class="image" /> <div style="padding: 14px;"> -- Gitblit v1.8.0