File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
src/uni_modules/wot-design-uni/components/wd-input-number Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ export default {
3636
3737<script lang="ts" setup>
3838import { ref , watch } from ' vue'
39- import { debounce , isDef } from ' ../common/util'
39+ import { debounce , isDef , isEqual } from ' ../common/util'
4040import { inputNumberProps } from ' ./types'
4141
4242const props = defineProps (inputNumberProps )
7575function updateBoundary() {
7676 debounce (() => {
7777 const value = formatValue (inputValue .value )
78- setValue (value )
78+ if (! isEqual (inputValue .value , value )) {
79+ setValue (value )
80+ }
7981 splitDisabled (value )
8082 }, 30 )()
8183}
@@ -161,13 +163,18 @@ function handleFocus(event: any) {
161163
162164function handleBlur() {
163165 const value = formatValue (inputValue .value )
164- setValue (value )
166+ if (! isEqual (inputValue .value , value )) {
167+ setValue (value )
168+ }
165169 emit (' blur' , {
166170 value
167171 })
168172}
169173
170174function dispatchChangeEvent(value : string | number , change : boolean = true ) {
175+ if (isEqual (inputValue .value , value )) {
176+ return
177+ }
171178 inputValue .value = value
172179 change && emit (' update:modelValue' , inputValue .value )
173180 change && emit (' change' , { value })
You can’t perform that action at this time.
0 commit comments