mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-10-15 05:02:09 +08:00
feat(Stepper): add disablePlus & disableMinus props (#2476)
This commit is contained in:
parent
76ab7189c4
commit
84fa1b00c9
@ -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
|
||||||
|
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user