From 0bbe5b6be60a2fa9c1e07496e3c35f81aa76c177 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E6=B4=81?= <209192278@qq.com> Date: Mon, 27 Nov 2023 14:18:18 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=93=E6=B4=81=20=EF=BC=9A=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=9C=B0=E5=9B=BE=E5=BA=97=E9=93=BA=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=B8=B2=E6=9F=93=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/ShowShopListItem/ShowShopListItem.vue | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/components/ShowShopListItem/ShowShopListItem.vue b/components/ShowShopListItem/ShowShopListItem.vue index 55d1555..f2a2c1a 100644 --- a/components/ShowShopListItem/ShowShopListItem.vue +++ b/components/ShowShopListItem/ShowShopListItem.vue @@ -142,9 +142,22 @@ }, computed: { + }, + watch: { + shopInfo(newVal, oldVal) { + if (newVal.pics.includes(",")) { + this.leftImage = this.$api.imgUrl + newVal.pics.split(',')[0] + } else { + this.leftImage = this.$api.imgUrl + newVal.pics + } + } }, created() { - this.leftImage = this.$api.imgUrl + this.shopInfo.pics.split(',')[0] + if (this.shopInfo.pics.includes(",")) { + this.leftImage = this.$api.imgUrl + this.shopInfo.pics.split(',')[0] + } else { + this.leftImage = this.$api.imgUrl + this.shopInfo.pics + } }, methods: { handleEdit(shopid) {