mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
* [bugfix] CouponList always show empty info * [bugfix] add click feedback of buttons in components * [Doc] add custom theme document * [new feature] Notice bar support more props * [bugfix] PullRefresh test cases * [bugfix] unused NoticeBar style * [bugfix] Swipe width calc error * [Doc] english document of all action components * [Doc] change document site path to /zanui/vant * [Doc] fix * [bugfix] uploader style error * [bugfix] tabs document demo * [new feature] Cell support vue-router target route * [bugfix] add cell test cases * update yarn.lock * [bugfix] Tabbar cann't display info when use icon slot * [Doc] update document title * [bugfix] Dialog should reset button text when showed * [new feature] CouponList add showCloseButton prop * [new feature] Swipe add 'initialSwipe' prop * [bugfix] NoticeBar text disappeared when page back * [new feature] ImagePreview support startPosition * fix: improve imagePreview test cases * [bugfix] Steps style error when has more than 4 items * [new feature] normalize size of all icons * [new feature] Stepper add plus & minus event * fix: yarn.lock * [bugfix] addressEdit icon render failed
1.6 KiB
1.6 KiB
Stepper 步进器
使用指南
import { Stepper } from 'vant';
Vue.component(Stepper.name, Stepper);
代码演示
基础用法
:::demo 基础用法
<van-stepper v-model="stepper1" />
export default {
data() {
return {
value: 1
}
}
}
:::
禁用状态
通过设置disabled
属性来禁用 stepper
:::demo 禁用状态
<van-stepper v-model="stepper1" disabled />
:::
高级用法
默认是每次加减为1,可以对组件设置step
、min
、max
、defaultValue
属性
:::demo 高级用法
<van-stepper v-model="stepper2" min="5" max="40" step="2" default-value="9" />
:::
API
参数 | 说明 | 类型 | 默认值 | 可选值 |
---|---|---|---|---|
min | 最小值 | `String | Number` | 1 |
max | 最大值 | `String | Number` | - |
defaultValue | 默认值 | `String | Number` | 1 |
step | 步数 | `String | Number` | 1 |
disabled | 是否禁用 | Boolean |
false |
- |
disableInput | 是否禁用input框 | Boolean |
false |
- |
Event
事件名称 | 说明 | 回调参数 |
---|---|---|
change | 当绑定值变化时触发的事件 | 当前组件的值 |
overlimit | 点击不可用的按钮时触发 | - |
plus | 点击增加按钮时触发 | - |
minus | 点击减少按钮时触发 | - |