@@ -148,7 +148,7 @@ export default defineComponent({
148
148
149
149
// Trigger onChange when max or min change
150
150
// https://github.com/ant-design/ant-design/issues/11574
151
- const nextValue = 'value' in props ? value : this . sValue ;
151
+ const nextValue = 'value' in props ? value : this . $data . sValue ;
152
152
// ref: null < 20 === true
153
153
// https://github.com/ant-design/ant-design/issues/14277
154
154
if (
@@ -187,14 +187,14 @@ export default defineComponent({
187
187
// This caused that if an input didn't init with the selection,
188
188
// set will cause cursor not correct when first focus.
189
189
// Safari will focus input if set selection. We need skip this.
190
- if ( this . cursorStart !== undefined && this . focused ) {
190
+ if ( this . cursorStart !== undefined && this . $data . focused ) {
191
191
// In most cases, the string after cursor is stable.
192
192
// We can move the cursor before it
193
193
194
194
if (
195
195
// If not match full str, try to match part of str
196
196
! this . partRestoreByAfter ( this . cursorAfter ) &&
197
- this . sValue !== this . value
197
+ this . $data . sValue !== this . value
198
198
) {
199
199
// If not match any of then, let's just keep the position
200
200
// TODO: Logic should not reach here, need check if happens
@@ -233,7 +233,7 @@ export default defineComponent({
233
233
if ( ! this . pressingUpOrDown ) {
234
234
return ;
235
235
}
236
- if ( this . focusOnUpDown && this . focused ) {
236
+ if ( this . focusOnUpDown && this . $data . focused ) {
237
237
if ( document . activeElement !== inputElem ) {
238
238
this . focus ( ) ;
239
239
}
@@ -266,7 +266,7 @@ export default defineComponent({
266
266
this . __emit ( 'keyup' , e , ...args ) ;
267
267
} ,
268
268
onChange ( e ) {
269
- if ( this . focused ) {
269
+ if ( this . $data . focused ) {
270
270
this . inputting = true ;
271
271
}
272
272
this . rawInput = this . parser ( this . getValueFromEvent ( e ) ) ;
@@ -286,7 +286,7 @@ export default defineComponent({
286
286
this . setState ( {
287
287
focused : false ,
288
288
} ) ;
289
- const value = this . getCurrentValidValue ( this . inputValue ) ;
289
+ const value = this . getCurrentValidValue ( this . $data . inputValue ) ;
290
290
const newValue = this . setValue ( value ) ;
291
291
if ( this . $attrs . onBlur ) {
292
292
const originValue = this . inputRef . value ;
@@ -303,7 +303,7 @@ export default defineComponent({
303
303
} else if ( ! this . isNotCompleteNumber ( parseFloat ( val , 10 ) ) ) {
304
304
val = this . getValidValue ( val ) ;
305
305
} else {
306
- val = this . sValue ;
306
+ val = this . $data . sValue ;
307
307
}
308
308
return this . toNumber ( val ) ;
309
309
} ,
@@ -363,7 +363,7 @@ export default defineComponent({
363
363
// always set input value same as value
364
364
this . setState (
365
365
{
366
- inputValue : this . toPrecisionAsStep ( this . sValue ) ,
366
+ inputValue : this . toPrecisionAsStep ( this . $data . sValue ) ,
367
367
} ,
368
368
callback ,
369
369
) ;
@@ -538,7 +538,7 @@ export default defineComponent({
538
538
} ,
539
539
toNumber ( num ) {
540
540
const { precision, autofocus } = this . $props ;
541
- const { focused = autofocus } = this ;
541
+ const { focused = autofocus } = this . $data ;
542
542
// num.length > 16 => This is to prevent input of large numbers
543
543
const numberIsTooLarge = num && num . length > 16 && focused ;
544
544
if ( this . isNotCompleteNumber ( num ) || numberIsTooLarge ) {
@@ -579,7 +579,7 @@ export default defineComponent({
579
579
return ;
580
580
}
581
581
const { max, min } = this ;
582
- const value = this . getCurrentValidValue ( this . inputValue ) || 0 ;
582
+ const value = this . getCurrentValidValue ( this . $data . inputValue ) || 0 ;
583
583
if ( this . isNotCompleteNumber ( value ) ) {
584
584
return ;
585
585
}
@@ -648,11 +648,11 @@ export default defineComponent({
648
648
[ className ] : className ,
649
649
[ prefixCls ] : true ,
650
650
[ `${ prefixCls } -disabled` ] : disabled ,
651
- [ `${ prefixCls } -focused` ] : this . focused ,
651
+ [ `${ prefixCls } -focused` ] : this . $data . focused ,
652
652
} ) ;
653
653
let upDisabledClass = '' ;
654
654
let downDisabledClass = '' ;
655
- const { sValue } = this ;
655
+ const { sValue } = this . $data ;
656
656
if ( sValue || sValue === 0 ) {
657
657
if ( ! isNaN ( sValue ) ) {
658
658
const val = Number ( sValue ) ;
0 commit comments