neverland 3d19ddb573
[new feature] Stepper add plus & minus event (#294)
* [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
2017-11-08 23:59:34 -06:00

87 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<style>
.demo-stepper {
.van-stepper {
margin-left: 15px;
}
}
</style>
<script>
export default {
data() {
return {
stepper1: 1,
stepper2: null,
};
}
};
</script>
## Stepper 步进器
### 使用指南
``` javascript
import { Stepper } from 'vant';
Vue.component(Stepper.name, Stepper);
```
### 代码演示
#### 基础用法
:::demo 基础用法
```html
<van-stepper v-model="stepper1" />
```
```javascript
export default {
data() {
return {
value: 1
}
}
}
```
:::
#### 禁用状态
通过设置`disabled`属性来禁用 stepper
:::demo 禁用状态
```html
<van-stepper v-model="stepper1" disabled />
```
:::
#### 高级用法
默认是每次加减为1可以对组件设置`step`、`min`、`max`、`defaultValue`属性
:::demo 高级用法
```html
<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 | 点击减少按钮时触发 | - |