Fix decimal input on the interface (#10491)

This commit is contained in:
ian
2021-12-14 23:09:29 +08:00
committed by GitHub
parent 5eafb62fea
commit ba6f90858b

View File

@@ -232,7 +232,12 @@ export default defineComponent({
}
if (props.type === 'number') {
emit('update:modelValue', Number(value));
const parsedNumber = Number(value);
// Ignore if numeric value remains unchanged
if (props.modelValue !== parsedNumber) {
emit('update:modelValue', parsedNumber);
}
} else {
if (props.slug === true) {
const endsWithSpace = value.endsWith(' ');