fix table重新渲染会修改props
This commit is contained in:
@@ -1058,7 +1058,7 @@ const _sfc_main = defineComponent({
|
||||
});
|
||||
};
|
||||
findFinalNode(0, tableColumns.value);
|
||||
const tableSelectedKeys = ref([...props.selectedKeys]);
|
||||
const tableSelectedKeys = ref(props.selectedKeys);
|
||||
const tableExpandKeys = ref([...props.expandKeys]);
|
||||
watch(() => props.selectedKeys, () => {
|
||||
tableSelectedKeys.value = props.selectedKeys;
|
||||
@@ -1102,7 +1102,10 @@ const _sfc_main = defineComponent({
|
||||
} else {
|
||||
hasChecked.value = false;
|
||||
}
|
||||
emit("update:selectedKeys", tableSelectedKeys.value);
|
||||
if (tableSelectedKeys.value != props.selectedKeys) {
|
||||
console.log("\u521D\u59CB\u5316\u8D4B\u503C\u89E6\u53D1\u4FEE\u6539", tableSelectedKeys.value, props.selectedKeys);
|
||||
emit("update:selectedKeys", tableSelectedKeys.value);
|
||||
}
|
||||
}, { deep: true, immediate: true });
|
||||
watch(tableExpandKeys, () => {
|
||||
emit("update:expandKeys", tableExpandKeys.value);
|
||||
|
||||
Reference in New Issue
Block a user