|
@@ -396,7 +396,16 @@
|
|
data.value.push(dataObj);
|
|
data.value.push(dataObj);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- console.log(data.value, 'valeu');
|
|
|
|
|
|
+ // 更改后
|
|
|
|
+ const listKey = list.map((x) => x[props.valueField]);
|
|
|
|
+ // 原数据
|
|
|
|
+ const sourceKey = data.value.map((x) => x[props.uniqueKey]);
|
|
|
|
+ //删除原数据中不存在的数据
|
|
|
|
+ sourceKey.map((item, index) => {
|
|
|
|
+ if (!listKey.includes(item)) {
|
|
|
|
+ data.value.splice(index, 1);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
emit('change', unref(data));
|
|
emit('change', unref(data));
|
|
emit('update:value', unref(data));
|
|
emit('update:value', unref(data));
|
|
};
|
|
};
|