Skip to content

Commit

Permalink
fix(input-number): 修复禁用无效问题 (#2680)
Browse files Browse the repository at this point in the history
Co-authored-by: iCheng <[email protected]>
  • Loading branch information
iCheng and iCheng authored Nov 20, 2023
1 parent 8fe7b9b commit 874fbb4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/packages/__VUE/inputnumber/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export default create({
return value > Number(props.min) && !props.disabled;
};
const reduce = (event: Event) => {
if (props.disabled) return;
emit('reduce', event);
let output_value = Number(props.modelValue) - Number(props.step);
if (reduceAllow() && output_value >= Number(props.min)) {
Expand All @@ -116,6 +117,7 @@ export default create({
}
};
const add = (event: Event) => {
if (props.disabled) return;
emit('add', event);
let output_value = Number(props.modelValue) + Number(props.step);
if (addAllow() && output_value <= Number(props.max)) {
Expand Down

0 comments on commit 874fbb4

Please sign in to comment.