[new feature] Swipe: support custom item width & height (#1664)

This commit is contained in:
xliez
2018-08-22 16:03:49 +08:00
committed by neverland
parent c96ef7cc47
commit ed2911f667
6 changed files with 65 additions and 8 deletions
+13
View File
@@ -77,6 +77,17 @@ export default {
</van-swipe>
```
#### Set Swiper Item Size
```html
<van-swipe :autoplay="3000" :width="300">
<van-swipe-item>1</van-swipe-item>
<van-swipe-item>2</van-swipe-item>
<van-swipe-item>3</van-swipe-item>
<van-swipe-item>4</van-swipe-item>
</van-swipe>
```
### API
| Attribute | Description | Type | Default |
@@ -88,6 +99,8 @@ export default {
| touchable | Whether touchable | `Boolean` | `true` |
| show-indicators | Whether to show indocators | `Boolean` | `true` |
| initial-swipe | Index of initial swipe, start from 0 | `Number` | `0` |
| width | Set Swiper Item Width | `Number` | `0` |
| height | Set Swiper Item Height | `Number` | `0` |
### Event