为什么要清空选中列表?

This commit is contained in:
Theluyuan 2023-02-03 16:00:58 +08:00
parent 4e160ffb4a
commit f598d35da2
4 changed files with 91 additions and 96 deletions

View File

@ -733,7 +733,6 @@ const _sfc_main = defineComponent({
const slot = useSlots(); const slot = useSlots();
slot.default && slot.default(); slot.default && slot.default();
const tableRef = ref(); const tableRef = ref();
const s = "";
const allChecked = ref(false); const allChecked = ref(false);
const hasChecked = ref(false); const hasChecked = ref(false);
const tableDataSource = ref([...props.dataSource]); const tableDataSource = ref([...props.dataSource]);
@ -840,8 +839,6 @@ const _sfc_main = defineComponent({
}); });
watch(() => props.dataSource, () => { watch(() => props.dataSource, () => {
tableDataSource.value = [...props.dataSource]; tableDataSource.value = [...props.dataSource];
tableSelectedKeys.value = [];
tableSelectedKey.value = s;
}, { deep: true }); }, { deep: true });
const changeAll = (isChecked) => { const changeAll = (isChecked) => {
if (isChecked) { if (isChecked) {

View File

@ -19151,7 +19151,6 @@ const _sfc_main$D = defineComponent({
const slot = useSlots(); const slot = useSlots();
slot.default && slot.default(); slot.default && slot.default();
const tableRef = ref(); const tableRef = ref();
const s = "";
const allChecked = ref(false); const allChecked = ref(false);
const hasChecked = ref(false); const hasChecked = ref(false);
const tableDataSource = ref([...props.dataSource]); const tableDataSource = ref([...props.dataSource]);
@ -19258,8 +19257,6 @@ const _sfc_main$D = defineComponent({
}); });
watch(() => props.dataSource, () => { watch(() => props.dataSource, () => {
tableDataSource.value = [...props.dataSource]; tableDataSource.value = [...props.dataSource];
tableSelectedKeys.value = [];
tableSelectedKey.value = s;
}, { deep: true }); }, { deep: true });
const changeAll = (isChecked) => { const changeAll = (isChecked) => {
if (isChecked) { if (isChecked) {

View File

@ -264,8 +264,9 @@ watch(
() => props.dataSource, () => props.dataSource,
() => { () => {
tableDataSource.value = [...props.dataSource]; tableDataSource.value = [...props.dataSource];
tableSelectedKeys.value = []; //
tableSelectedKey.value = s; // tableSelectedKeys.value = [];
// tableSelectedKey.value = s;
}, },
{ deep: true } { deep: true }
); );

File diff suppressed because one or more lines are too long