From 2a91774e6fa2a59d0fcbd3561ddd30679bcaaf74 Mon Sep 17 00:00:00 2001 From: wangyufei <2267742828@qq.com> Date: Sun, 11 Aug 2024 18:39:14 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=B8=B2=E6=9F=93=E5=9B=9E?= =?UTF-8?q?=E8=B0=83=E5=BB=B6=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Table/src/Table.vue | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/components/Table/src/Table.vue b/src/components/Table/src/Table.vue index b593ef265..4d9308544 100644 --- a/src/components/Table/src/Table.vue +++ b/src/components/Table/src/Table.vue @@ -123,14 +123,16 @@ export default defineComponent({ const sortRef = ref() // 选中某行 const selectRow = (selection,row)=>{ - console.log('selectRow',row) - const selected = elTableRef.value?.getSelectionRows().some((item) => item.id === row.id) - if(props.isCheckStrictly&&selected&&row.children){//取消关联 - row.children.forEach(item => { - elTableRef.value?.toggleRowSelection(item, false); - }); - } emit('getSelectionRows', currentPageRef.value,elTableRef.value?.getSelectionRows()) + nextTick(()=>{ + const selected = elTableRef.value?.getSelectionRows().some((item) => item.id === row.id) + + if(props.isCheckStrictly&&selected&&row.children){//取消关联 + row.children.forEach(item => { + elTableRef.value?.toggleRowSelection(item, false); + }); + } + }) } //全选回调 const selectAll = ()=>{