|
@@ -399,15 +399,10 @@
|
|
|
// 更改后
|
|
|
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('update:value', unref(data));
|
|
|
+ const newData = data.value.filter((item) => listKey.includes(item[props.uniqueKey]));
|
|
|
+ console.log(newData);
|
|
|
+ emit('change', newData);
|
|
|
+ emit('update:value', newData);
|
|
|
};
|
|
|
|
|
|
watch(
|