From 86dae538b9533d8f41e2fac41657b421ce9d4bff Mon Sep 17 00:00:00 2001 From: From-wh Date: Sun, 28 Sep 2025 10:30:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=A1=BA=E5=BA=8F=E4=B8=8D=E4=B8=80=E8=87=B4?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根据nVal的顺序查找listData,保持查找结果的顺序一致 --- template/admin/src/components/goodsLabel/useLabel.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/template/admin/src/components/goodsLabel/useLabel.vue b/template/admin/src/components/goodsLabel/useLabel.vue index c81e1ea28..1cf79a0ba 100644 --- a/template/admin/src/components/goodsLabel/useLabel.vue +++ b/template/admin/src/components/goodsLabel/useLabel.vue @@ -66,10 +66,13 @@ export default { if (nVal != oVal) { if (nVal.length) { this.labelList = []; - this.listData.map((item) => { - if (nVal.includes(item.id)) { - this.labelList.push(item); - } + // 根据nVal 去listData 中查找 不改变查找出来的顺序 + nVal.forEach((item) => { + this.listData.forEach((item2) => { + if (item == item2.id) { + this.labelList.push(item2); + } + }); }); } }