fix: 修复标签列表顺序不一致的问题

根据nVal的顺序查找listData,保持查找结果的顺序一致
This commit is contained in:
From-wh 2025-09-28 10:30:40 +08:00
parent 477fb37c06
commit 86dae538b9

View File

@ -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);
}
});
});
}
}