Skip to content

Commit

Permalink
fix: 修复taro中input-number组件点击icon可能超出min-max范围问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Formulaaa authored Oct 22, 2023
1 parent fac02ec commit db05975
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/packages/__VUE/inputnumber/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,18 @@ export default create({
};
const reduce = (event: Event) => {
emit('reduce', event);
if (reduceAllow()) {
let output_value = Number(props.modelValue) - Number(props.step);
let output_value = Number(props.modelValue) - Number(props.step);
if (reduceAllow() && output_value >= Number(props.min)) {
emitChange(output_value, event);
} else {
emit('overlimit', event, 'reduce');
}
};
const add = (event: Event) => {
emit('add', event);
if (addAllow()) {
let output_value = Number(props.modelValue) + Number(props.step);
emitChange(output_value, event);
let output_value = Number(props.modelValue) + Number(props.step);
if (addAllow() && output_value <= Number(props.max)) {
emitChange(output_value, event);X
} else {
emit('overlimit', event, 'add');
}
Expand Down

0 comments on commit db05975

Please sign in to comment.