@@ -35,7 +35,7 @@ import defaultLocale from '../locale/en_US';
3535import type { SizeType } from '../config-provider' ;
3636import devWarning from '../vc-util/devWarning' ;
3737import type { PropType } from 'vue' ;
38- import { reactive , ref , computed , defineComponent , toRef , watchEffect } from 'vue' ;
38+ import { reactive , ref , computed , defineComponent , toRef , watchEffect , watch } from 'vue' ;
3939import type { DefaultRecordType } from '../vc-table/interface' ;
4040import useBreakpoint from '../_util/hooks/useBreakpoint' ;
4141import useConfigInject from '../_util/hooks/useConfigInject' ;
@@ -487,23 +487,27 @@ const InteralTable = defineComponent<
487487 }
488488 return props . expandIconColumnIndex ;
489489 } ) ;
490-
491- // ========================== Selections ==========================
492- const [ transformSelectionColumns , selectedKeySet ] = useSelection (
493- computed ( ( ) => props . rowSelection ) ,
494- {
495- prefixCls,
496- data : mergedData ,
497- pageData,
498- getRowKey,
499- getRecordByKey,
500- expandType,
501- childrenColumnName,
502- locale : tableLocale ,
503- expandIconColumnIndex,
504- getPopupContainer : computed ( ( ) => props . getPopupContainer ) ,
490+ const rowSelection = ref ( ) ;
491+ watch (
492+ ( ) => props . rowSelection ,
493+ ( ) => {
494+ rowSelection . value = { ...props . rowSelection } ;
505495 } ,
496+ { deep : true } ,
506497 ) ;
498+ // ========================== Selections ==========================
499+ const [ transformSelectionColumns , selectedKeySet ] = useSelection ( rowSelection , {
500+ prefixCls,
501+ data : mergedData ,
502+ pageData,
503+ getRowKey,
504+ getRecordByKey,
505+ expandType,
506+ childrenColumnName,
507+ locale : tableLocale ,
508+ expandIconColumnIndex,
509+ getPopupContainer : computed ( ( ) => props . getPopupContainer ) ,
510+ } ) ;
507511
508512 const internalRowClassName = ( record : any , index : number , indent : number ) => {
509513 let mergedRowClassName ;
0 commit comments