Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

解决nut-input-number组件在ios中点击小数点后会清空输入框的问题 #2704

Merged
merged 8 commits into from
Dec 15, 2023
2 changes: 1 addition & 1 deletion src/packages/__VUE/inputnumber/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export default create({
};
const change = (event: Event) => {
const input = event.target as HTMLInputElement;
emit('update:modelValue', Number(input.value), event);
emit('update:modelValue', input.value, event);
};
const emitChange = (value: string | number, event: Event) => {
let output_value: number | string = fixedDecimalPlaces(value);
Expand Down
4 changes: 3 additions & 1 deletion src/packages/__VUE/inputnumber/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@
};
const change = (event: Event) => {
const input = event.target as HTMLInputElement;
emit('update:modelValue', input.valueAsNumber, event);

emit('update:modelValue', input.value, event);

Check warning on line 96 in src/packages/__VUE/inputnumber/index.vue

View check run for this annotation

Codecov / codecov/patch

src/packages/__VUE/inputnumber/index.vue#L95-L96

Added lines #L95 - L96 were not covered by tests
};
const emitChange = (value: string | number, event: Event) => {
let output_value: number | string = fixedDecimalPlaces(value);
Expand Down Expand Up @@ -154,6 +155,7 @@
}
return value;
};

watch(
() => [props.max, props.min],
() => {
Expand Down