mirror of
https://github.com/youzan/vant.git
synced 2025-12-18 02:06:02 +08:00
[new feature] add i18n support (#310)
* fix: Tabbar icon line-height * [new feature] progress add showPivot prop * [new feature] TabItem support vue-router * [new feature] update document header style * [Doc] add toast english ducoment * [new feature] add i18n support * feat: Extract demos from markdown * feat: Base components demos * [new feature] complete demo extract & translate * [fix] text cases * fix: add deepAssign test cases * fix: changelog detail * [new feature] AddressEdit support i18n
This commit is contained in:
62
docs/markdown/zh-CN/swipe.md
Normal file
62
docs/markdown/zh-CN/swipe.md
Normal file
@@ -0,0 +1,62 @@
|
||||
## Swipe 轮播
|
||||
|
||||
### 使用指南
|
||||
``` javascript
|
||||
import { Swipe, SwipeItem } from 'vant';
|
||||
|
||||
Vue.component(Swipe.name, Swipe);
|
||||
Vue.component(SwipeItem.name, SwipeItem);
|
||||
```
|
||||
|
||||
### 代码演示
|
||||
|
||||
#### 基础用法
|
||||
通过`autoplay`属性设置自动轮播间隔
|
||||
|
||||
```html
|
||||
<van-swipe :autoplay="3000">
|
||||
<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>
|
||||
```
|
||||
|
||||
#### 图片懒加载
|
||||
配合 [Lazyload](#/zh-CN/component/lazyload) 组件实现图片懒加载
|
||||
|
||||
```html
|
||||
<van-swipe :autoplay="3000">
|
||||
<van-swipe-item v-for="(image, index) in images" :key="index">
|
||||
<img v-lazy="image" />
|
||||
</van-swipe-item>
|
||||
</van-swipe>
|
||||
```
|
||||
|
||||
```javascript
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
images: [
|
||||
'https://img.yzcdn.cn/1.jpg',
|
||||
'https://img.yzcdn.cn/2.jpg'
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### API
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
|
||||
|-----------|-----------|-----------|-------------|-------------|
|
||||
| autoplay | 自动轮播间隔,单位为 ms | `Number` | - | - |
|
||||
| duration | 动画时长,单位为 ms | `Number` | `500` | - |
|
||||
| showIndicators | 是否显示指示器 | `Boolean` | `true` | - |
|
||||
| initialSwipe | 初始位置,从 0 开始算 | `Number` | `0` | - |
|
||||
|
||||
### 事件
|
||||
|
||||
| 事件名 | 说明 | 参数 |
|
||||
|-----------|-----------|-----------|
|
||||
| change | 每一页轮播结束后触发 | index, 当前页的索引 |
|
||||
Reference in New Issue
Block a user