@@ -35,7 +35,7 @@ import defaultLocale from '../locale/en_US';
35
35
import type { SizeType } from '../config-provider' ;
36
36
import devWarning from '../vc-util/devWarning' ;
37
37
import 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' ;
39
39
import type { DefaultRecordType } from '../vc-table/interface' ;
40
40
import useBreakpoint from '../_util/hooks/useBreakpoint' ;
41
41
import useConfigInject from '../_util/hooks/useConfigInject' ;
@@ -487,23 +487,27 @@ const InteralTable = defineComponent<
487
487
}
488
488
return props . expandIconColumnIndex ;
489
489
} ) ;
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 } ;
505
495
} ,
496
+ { deep : true } ,
506
497
) ;
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
+ } ) ;
507
511
508
512
const internalRowClassName = ( record : any , index : number , indent : number ) => {
509
513
let mergedRowClassName ;
0 commit comments