提交 5471cacb 编写于 作者: D dolymood

slide refresh demo & doc

上级 aa6b96d9
......@@ -98,8 +98,15 @@
| threshold | sliding threshold of switching pages | Number | (0, 1) | 0.3 |
| speed | speed of switching pages | Number | - | 400 |
### 事件
### Events
| Event Name | Description | Parameters |
| - | - | - |
| change | triggers when current slide changes | index of current slide |
### Instance methods
| Method name | Description |
| - | - |
| refresh | You can call this method when slide items added or removed |
......@@ -71,7 +71,7 @@
```html
<cube-slide :interval="4000"></cube-slide>
```
- 切换页面的滑动阈值
可通过`threshold`属性配置切换页面的滑动阈值,既当滑动的距离超过了页面宽度 × `threshold`时,切换页面。默认值为0.3。
......@@ -102,3 +102,9 @@
| 事件名 | 说明 | 参数 |
| - | - | - |
| change | Slide 当前展示项发生改变时触发 | 当前展示项的索引值 |
### 实例方法
| 方法名 | 说明 |
| - | - |
| refresh | 当轮播图内容删减的时候,可以调用此方法进行更新 |
......@@ -45,7 +45,6 @@
</template>
<script type="text/ecmascript-6">
import Vue from 'vue'
import CubePage from '../components/cube-page.vue'
import SwitchOption from '../components/switch-option'
import InputOption from '../components/input-option'
......@@ -98,10 +97,11 @@
console.log(item, index)
},
rebuildSlide() {
this.ifSlide = false
Vue.nextTick(() => {
this.ifSlide = true
})
this.$refs.slide.refresh()
// this.ifSlide = false
// this.$nextTick(() => {
// this.ifSlide = true
// })
},
updateLoop(val) {
this.loop = val
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册