@@ -16,6 +16,7 @@ import {
1616 isValidElement ,
1717 filterEmpty ,
1818 getAllProps ,
19+ getComponentFromProp ,
1920} from '../_util/props-util' ;
2021import BaseMixin from '../_util/BaseMixin' ;
2122import { ConfigConsumerProps } from '../config-provider' ;
@@ -84,15 +85,18 @@ export default {
8485
8586 data ( ) {
8687 // 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+ ) ;
8893 this . createComponents ( this . components ) ;
8994 this . CheckboxPropsCache = { } ;
9095
9196 this . store = createStore ( {
9297 selectedRowKeys : getRowSelection ( this . $props ) . selectedRowKeys || [ ] ,
9398 selectionDirty : false ,
9499 } ) ;
95- this . prevRowSelection = this . rowSelection ? { ...this . rowSelection } : this . rowSelection ;
96100 return {
97101 ...this . getDefaultSortOrder ( this . columns ) ,
98102 // 减少状态
@@ -118,7 +122,7 @@ export default {
118122 deep : true ,
119123 } ,
120124 rowSelection : {
121- handler ( val ) {
125+ handler ( val , oldVal ) {
122126 if ( val && 'selectedRowKeys' in val ) {
123127 this . store . setState ( {
124128 selectedRowKeys : val . selectedRowKeys || [ ] ,
@@ -127,12 +131,11 @@ export default {
127131 if ( rowSelection && val . getCheckboxProps !== rowSelection . getCheckboxProps ) {
128132 this . CheckboxPropsCache = { } ;
129133 }
130- } else if ( val && ! this . prevRowSelection ) {
134+ } else if ( oldVal && ! val ) {
131135 this . store . setState ( {
132136 selectedRowKeys : [ ] ,
133137 } ) ;
134138 }
135- this . prevRowSelection = val ? { ...val } : val ;
136139 } ,
137140 deep : true ,
138141 } ,
@@ -823,6 +826,7 @@ export default {
823826 class = { `${ prefixCls } -column-sorter-up ${ isAscend ? 'on' : 'off' } ` }
824827 type = "caret-up"
825828 theme = "filled"
829+ key = "caret-up"
826830 />
827831 ) ;
828832
@@ -831,6 +835,7 @@ export default {
831835 class = { `${ prefixCls } -column-sorter-down ${ isDescend ? 'on' : 'off' } ` }
832836 type = "caret-down"
833837 theme = "filled"
838+ key = "caret-down"
834839 />
835840 ) ;
836841
0 commit comments