mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(Stepper): should format model-value
This commit is contained in:
parent
c4214b96a2
commit
81494dfa13
@ -201,7 +201,9 @@ export default createComponent({
|
|||||||
input.value = formatted;
|
input.value = formatted;
|
||||||
}
|
}
|
||||||
|
|
||||||
setValue(formatted);
|
// perfer number type
|
||||||
|
const isNumeric = formatted === String(+formatted);
|
||||||
|
setValue(isNumeric ? +formatted : formatted);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onFocus = (event: Event) => {
|
const onFocus = (event: Event) => {
|
||||||
@ -290,7 +292,7 @@ export default createComponent({
|
|||||||
() => props.modelValue,
|
() => props.modelValue,
|
||||||
(value) => {
|
(value) => {
|
||||||
if (!equal(value, current.value)) {
|
if (!equal(value, current.value)) {
|
||||||
current.value = value!;
|
current.value = format(value!);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user