@@ -184,12 +184,33 @@ function onChange(e) {
184184}
185185```
186186
187+ ## 属性控制切换
188+ ``` html
189+ <wd-swiper :loop =" isLoop" :autoplay =" false" :list =" swiperList" v-model:current =" current" />
190+ <wd-gap />
191+ <wd-cell-group >
192+ <wd-cell title =" loop" >
193+ <wd-switch v-model =" isLoop" size =" 24px" />
194+ </wd-cell >
195+ <wd-cell title =" current" :value =" current.toString()" />
196+ </wd-cell-group >
197+ <view style =" display : flex ; justify-content : space-between " >
198+ <wd-button @click =" current--" >prev</wd-button >
199+ <wd-button type =" success" @click =" current++" >next</wd-button >
200+ </view >
201+ ```
202+
203+ ``` javascript
204+ const current = ref< number> (0 )
205+ const isLoop = ref (false )
206+ ```
207+
187208## Attributes
188209
189210| 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 |
190211| -------------------- | ------------------------------------------------------ | ------------------------- | ---------- | ---------- | -------- |
191212| autoplay | 是否自动播放 | ` boolean ` | - | true | 0.1.22 |
192- | current | 当前轮播在哪一项 (下标) | ` number ` | - | 0 | 0.1.22 |
213+ | v-model : current | 控制当前轮播在哪一项 (下标) | ` number ` | - | 0 | 0.1.22 |
193214| direction | 轮播滑动方向 | ` DirectionType ` | ` horizontal, vertical ` | horizontal | 0.1.22 |
194215| displayMultipleItems | 同时显示的滑块数量 | ` number ` | - | 1 | 0.1.22 |
195216| duration | 滑动动画时长 | ` number ` | - | 300 | 0.1.22 |
@@ -226,15 +247,15 @@ function onChange(e) {
226247### SwiperIndicatorProps
227248
228249| 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 |
229- | ------------------- | -------------------------- | ---------------------- | ------------------------------------------------------------------------ | ---------- | -------- |
250+ | ------------------- | -------------------------- | ---------------------- | ------------------------------------------------------------------------ | ---------- | -------- |
230251| current | 当前轮播在哪一项(下标) | Number | - | 0 | 0.1.22 |
231252| direction | 轮播滑动方向 | DirectionType | ` horizontal, vertical ` | horizontal | 0.1.22 |
232253| min-show-num | 小于这个数字不会显示导航器 | Number | - | 2 | 0.1.22 |
233254| pagination-position | 页码信息展示位置 | IndicatorPositionType | ` left, top-left, top, top-right, bottom-left, bottom, bottom-right, right ` | bottom | 0.1.22 |
234255| show-controls | 是否显示控制按钮 | Boolean | - | false | 0.1.22 |
235256| total | 总共的项数 | Number | - | 0 | 0.1.22 |
236257| type | 导航器类型 | SwiperIndicatorType | ` dots, dots-bar, fraction ` | dots | 0.1.22 |
237- | autoplay | 是否自动播放 | boolean | - | true | 0.1.22 |
258+ | autoplay | 是否自动播放 | boolean | - | true | 0.1.22 |
238259
239260## Events
240261
0 commit comments