@@ -116,7 +116,8 @@ export default defineComponent({
116
116
} )
117
117
118
118
const internalData : NumberInputInternalData = {
119
- dnTimeout : undefined
119
+ // dnTimeout: undefined,
120
+ // isUM: undefined
120
121
}
121
122
122
123
const refElem = ref ( ) as Ref < HTMLDivElement >
@@ -291,6 +292,7 @@ export default defineComponent({
291
292
const handleChange = ( val : number | null , inputValue : string , evnt : Event | { type : string } ) => {
292
293
const value = eqEmptyValue ( val ) ? null : Number ( val )
293
294
const isChange = value !== props . modelValue
295
+ internalData . isUM = true
294
296
if ( isChange ) {
295
297
emit ( 'update:modelValue' , value )
296
298
}
@@ -361,6 +363,23 @@ export default defineComponent({
361
363
}
362
364
}
363
365
366
+ const updateModel = ( val : any ) => {
367
+ const { inputValue } = reactData
368
+ const digitsValue = computeDigitsValue . value
369
+ const decimalsType = computeDecimalsType . value
370
+ if ( decimalsType ) {
371
+ if ( val ) {
372
+ let textValue = ''
373
+ if ( val ) {
374
+ textValue = toFloatValueFixed ( val , digitsValue )
375
+ }
376
+ if ( textValue !== inputValue ) {
377
+ reactData . inputValue = textValue
378
+ }
379
+ }
380
+ }
381
+ }
382
+
364
383
/**
365
384
* 检查初始值
366
385
*/
@@ -826,7 +845,10 @@ export default defineComponent({
826
845
$xeNumberInput . renderVN = renderVN
827
846
828
847
watch ( ( ) => props . modelValue , ( val ) => {
829
- reactData . inputValue = val
848
+ if ( ! internalData . isUM ) {
849
+ updateModel ( val )
850
+ }
851
+ internalData . isUM = false
830
852
} )
831
853
832
854
watch ( ( ) => props . type , ( ) => {
0 commit comments