From edcb64fbf6af0760aea21012f7a438d4b477e919 Mon Sep 17 00:00:00 2001 From: linxi Date: Wed, 18 Sep 2024 16:11:25 +0800 Subject: [PATCH] =?UTF-8?q?Fix=EF=BC=9A=E6=B2=A1=E6=9C=89=E4=BC=98?= =?UTF-8?q?=E6=83=A0=E5=88=B8=E6=97=B6=E6=9C=80=E5=A4=A7=E5=80=BC=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/CouponsPopup.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/components/CouponsPopup.vue b/components/CouponsPopup.vue index eee1be7..62714b5 100644 --- a/components/CouponsPopup.vue +++ b/components/CouponsPopup.vue @@ -157,8 +157,10 @@ export default { return maxIndex }, largOne() { - this.selectCoupon(this.list[this.maxIndex].id) - return this.list[this.maxIndex] + if(this.list[this.maxIndex]) { + this.selectCoupon(this.list[this.maxIndex].id) + } + return this.list[this.maxIndex] || {} } }, @@ -171,7 +173,7 @@ export default { }, selectCoupon(id) { this.couponId = id - this.selectItem = this.list.find(e => e.id === id) + this.selectItem = this.list.find(e => e.id === id) || {} this.list.map(item => { item.checked = id === item.id })