@@ -16,6 +16,7 @@ import {
16
16
isValidElement ,
17
17
filterEmpty ,
18
18
getAllProps ,
19
+ getComponentFromProp ,
19
20
} from '../_util/props-util' ;
20
21
import BaseMixin from '../_util/BaseMixin' ;
21
22
import { ConfigConsumerProps } from '../config-provider' ;
@@ -84,15 +85,18 @@ export default {
84
85
85
86
data ( ) {
86
87
// this.columns = props.columns || normalizeColumns(props.children)
87
-
88
+ const props = getOptionProps ( this ) ;
89
+ warning (
90
+ ! ( 'expandedRowRender' in props ) || ! ( 'scroll' in props ) ,
91
+ '`expandedRowRender` and `scroll` are not compatible. Please use one of them at one time.' ,
92
+ ) ;
88
93
this . createComponents ( this . components ) ;
89
94
this . CheckboxPropsCache = { } ;
90
95
91
96
this . store = createStore ( {
92
97
selectedRowKeys : getRowSelection ( this . $props ) . selectedRowKeys || [ ] ,
93
98
selectionDirty : false ,
94
99
} ) ;
95
- this . prevRowSelection = this . rowSelection ? { ...this . rowSelection } : this . rowSelection ;
96
100
return {
97
101
...this . getDefaultSortOrder ( this . columns ) ,
98
102
// 减少状态
@@ -118,7 +122,7 @@ export default {
118
122
deep : true ,
119
123
} ,
120
124
rowSelection : {
121
- handler ( val ) {
125
+ handler ( val , oldVal ) {
122
126
if ( val && 'selectedRowKeys' in val ) {
123
127
this . store . setState ( {
124
128
selectedRowKeys : val . selectedRowKeys || [ ] ,
@@ -127,12 +131,11 @@ export default {
127
131
if ( rowSelection && val . getCheckboxProps !== rowSelection . getCheckboxProps ) {
128
132
this . CheckboxPropsCache = { } ;
129
133
}
130
- } else if ( val && ! this . prevRowSelection ) {
134
+ } else if ( oldVal && ! val ) {
131
135
this . store . setState ( {
132
136
selectedRowKeys : [ ] ,
133
137
} ) ;
134
138
}
135
- this . prevRowSelection = val ? { ...val } : val ;
136
139
} ,
137
140
deep : true ,
138
141
} ,
@@ -823,6 +826,7 @@ export default {
823
826
class = { `${ prefixCls } -column-sorter-up ${ isAscend ? 'on' : 'off' } ` }
824
827
type = "caret-up"
825
828
theme = "filled"
829
+ key = "caret-up"
826
830
/>
827
831
) ;
828
832
@@ -831,6 +835,7 @@ export default {
831
835
class = { `${ prefixCls } -column-sorter-down ${ isDescend ? 'on' : 'off' } ` }
832
836
type = "caret-down"
833
837
theme = "filled"
838
+ key = "caret-down"
834
839
/>
835
840
) ;
836
841
0 commit comments