File tree 4 files changed +13
-13
lines changed
4 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ const Select = {
161
161
return {
162
162
...state ,
163
163
_mirrorInputValue : state . _inputValue , // https://github.com/vueComponent/ant-design-vue/issues/1458
164
- ...this . getDerivedStateFromProps ( props , state ) ,
164
+ ...this . getDerivedState ( props , state ) ,
165
165
} ;
166
166
} ,
167
167
@@ -179,7 +179,7 @@ const Select = {
179
179
} ,
180
180
watch : {
181
181
__propsSymbol__ ( ) {
182
- Object . assign ( this . $data , this . getDerivedStateFromProps ( getOptionProps ( this ) , this . $data ) ) ;
182
+ Object . assign ( this . $data , this . getDerivedState ( getOptionProps ( this ) , this . $data ) ) ;
183
183
} ,
184
184
'$data._inputValue' ( val ) {
185
185
this . $data . _mirrorInputValue = val ;
@@ -210,7 +210,7 @@ const Select = {
210
210
}
211
211
} ,
212
212
methods : {
213
- getDerivedStateFromProps ( nextProps , prevState ) {
213
+ getDerivedState ( nextProps , prevState ) {
214
214
const optionsInfo = prevState . _skipBuildOptionsInfo
215
215
? prevState . _optionsInfo
216
216
: this . getOptionsInfoFromProps ( nextProps , prevState ) ;
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import { createRef } from '../util';
9
9
// onTreeNodeSelect: PropTypes.func.isRequired,
10
10
// onTreeNodeCheck: PropTypes.func.isRequired,
11
11
// }
12
- function getDerivedStateFromProps ( nextProps , prevState ) {
12
+ function getDerivedState ( nextProps , prevState ) {
13
13
const {
14
14
_prevProps : prevProps = { } ,
15
15
_loadedKeys : loadedKeys ,
@@ -106,7 +106,7 @@ const BasePopup = {
106
106
} ,
107
107
watch : {
108
108
__propsSymbol__ ( ) {
109
- const state = getDerivedStateFromProps ( this . $props , this . $data ) ;
109
+ const state = getDerivedState ( this . $props , this . $data ) ;
110
110
this . setState ( state ) ;
111
111
} ,
112
112
} ,
@@ -124,14 +124,14 @@ const BasePopup = {
124
124
const state = {
125
125
_keyList : [ ] ,
126
126
_expandedKeyList : expandedKeyList ,
127
- // Cache `expandedKeyList` when tree is in filter. This is used in `getDerivedStateFromProps `
127
+ // Cache `expandedKeyList` when tree is in filter. This is used in `getDerivedState `
128
128
_cachedExpandedKeyList : [ ] ,
129
129
_loadedKeys : [ ] ,
130
130
_prevProps : { } ,
131
131
} ;
132
132
return {
133
133
...state ,
134
- ...getDerivedStateFromProps ( this . $props , state ) ,
134
+ ...getDerivedState ( this . $props , state ) ,
135
135
} ;
136
136
} ,
137
137
methods : {
Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ const Select = {
187
187
_treeNodes : undefined ,
188
188
_filteredTreeNodes : undefined ,
189
189
} ;
190
- const newState = this . getDerivedStateFromProps ( this . $props , state ) ;
190
+ const newState = this . getDerivedState ( this . $props , state ) ;
191
191
return {
192
192
...state ,
193
193
...newState ,
@@ -215,7 +215,7 @@ const Select = {
215
215
watch : {
216
216
...getWatch ( [ 'treeData' , 'defaultValue' , 'value' ] ) ,
217
217
__propsSymbol__ ( ) {
218
- const state = this . getDerivedStateFromProps ( this . $props , this . $data ) ;
218
+ const state = this . getDerivedState ( this . $props , this . $data ) ;
219
219
this . setState ( state ) ;
220
220
this . needSyncKeys = { } ;
221
221
} ,
@@ -266,7 +266,7 @@ const Select = {
266
266
} ,
267
267
268
268
methods : {
269
- getDerivedStateFromProps ( nextProps , prevState ) {
269
+ getDerivedState ( nextProps , prevState ) {
270
270
const h = this . $createElement ;
271
271
const { _prevProps : prevProps = { } } = prevState ;
272
272
const {
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ const Tree = {
128
128
} ;
129
129
return {
130
130
...state ,
131
- ...this . getDerivedStateFromProps ( getOptionProps ( this ) , state ) ,
131
+ ...this . getDerivedState ( getOptionProps ( this ) , state ) ,
132
132
} ;
133
133
} ,
134
134
provide ( ) {
@@ -148,13 +148,13 @@ const Tree = {
148
148
'loadedKeys' ,
149
149
] ) ,
150
150
__propsSymbol__ ( ) {
151
- this . setState ( this . getDerivedStateFromProps ( getOptionProps ( this ) , this . $data ) ) ;
151
+ this . setState ( this . getDerivedState ( getOptionProps ( this ) , this . $data ) ) ;
152
152
this . needSyncKeys = { } ;
153
153
} ,
154
154
} ,
155
155
156
156
methods : {
157
- getDerivedStateFromProps ( props , prevState ) {
157
+ getDerivedState ( props , prevState ) {
158
158
const { _prevProps } = prevState ;
159
159
const newState = {
160
160
_prevProps : { ...props } ,
You can’t perform that action at this time.
0 commit comments