mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
[new feature] Stepper: add show-plus & show-minus prop (#1839)
This commit is contained in:
parent
5580379153
commit
dfdc001ea3
@ -55,6 +55,8 @@
|
|||||||
| disable-input | 是否禁用输入框 | `Boolean` | `false` |
|
| disable-input | 是否禁用输入框 | `Boolean` | `false` |
|
||||||
| async-change | 异步变更,为 `true` 时input值不变化,仅触发事件 | `Boolean` | `false` |
|
| async-change | 异步变更,为 `true` 时input值不变化,仅触发事件 | `Boolean` | `false` |
|
||||||
| input-width | 输入框宽度,须指定单位 | `String` | `30px` |
|
| input-width | 输入框宽度,须指定单位 | `String` | `30px` |
|
||||||
|
| show-plus | 是否显示增加按钮 | `Boolean` | `true` |
|
||||||
|
| show-minus | 是否显示减少按钮 | `Boolean` | `true` |
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
|
@ -27,6 +27,14 @@ VantComponent({
|
|||||||
step: {
|
step: {
|
||||||
type: null,
|
type: null,
|
||||||
value: 1
|
value: 1
|
||||||
|
},
|
||||||
|
showPlus: {
|
||||||
|
type: Boolean,
|
||||||
|
value: true
|
||||||
|
},
|
||||||
|
showMinus: {
|
||||||
|
type: Boolean,
|
||||||
|
value: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
<view class="van-stepper custom-class">
|
<view class="van-stepper custom-class">
|
||||||
<view
|
<view
|
||||||
class="minus-class {{ utils.bem('stepper__minus', { disabled: minusDisabled }) }}"
|
class="minus-class {{ utils.bem('stepper__minus', { disabled: minusDisabled }) }}"
|
||||||
|
style="{{ showMinus ? '' : 'display: none;' }}"
|
||||||
hover-class="van-stepper__minus--hover"
|
hover-class="van-stepper__minus--hover"
|
||||||
hover-stay-time="70"
|
hover-stay-time="70"
|
||||||
bind:tap="onMinus"
|
bind:tap="onMinus"
|
||||||
@ -20,6 +21,7 @@
|
|||||||
/>
|
/>
|
||||||
<view
|
<view
|
||||||
class="plus-class {{ utils.bem('stepper__plus', { disabled: plusDisabled }) }}"
|
class="plus-class {{ utils.bem('stepper__plus', { disabled: plusDisabled }) }}"
|
||||||
|
style="{{ showPlus ? '' : 'display: none;' }}"
|
||||||
hover-class="van-stepper__plus--hover"
|
hover-class="van-stepper__plus--hover"
|
||||||
hover-stay-time="70"
|
hover-stay-time="70"
|
||||||
bind:tap="onPlus"
|
bind:tap="onPlus"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user