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) {