feat(Stepper): add disablePlus & disableMinus props (#2476)

This commit is contained in:
Jake 2019-12-05 14:39:34 +08:00 committed by rex
parent 76ab7189c4
commit 84fa1b00c9
2 changed files with 7 additions and 3 deletions

View File

@ -57,6 +57,8 @@
| input-width | 输入框宽度,须指定单位 | `String` | `30px` | | input-width | 输入框宽度,须指定单位 | `String` | `30px` |
| show-plus | 是否显示增加按钮 | `Boolean` | `true` | | show-plus | 是否显示增加按钮 | `Boolean` | `true` |
| show-minus | 是否显示减少按钮 | `Boolean` | `true` | | show-minus | 是否显示减少按钮 | `Boolean` | `true` |
| disable-plus | 是否禁用增加按钮 | `Boolean` | - |
| disable-minus | 是否禁用减少按钮 | `Boolean` | - |
### Events ### Events

View File

@ -36,16 +36,18 @@ VantComponent({
showMinus: { showMinus: {
type: Boolean, type: Boolean,
value: true value: true
} },
disablePlus: Boolean,
disableMinus: Boolean
}, },
computed: { computed: {
minusDisabled() { minusDisabled() {
return this.data.disabled || this.data.value <= this.data.min; return this.data.disabled || this.data.disableMinus || this.data.value <= this.data.min;
}, },
plusDisabled() { plusDisabled() {
return this.data.disabled || this.data.value >= this.data.max; return this.data.disabled || this.data.disablePlus || this.data.value >= this.data.max;
} }
}, },