
参数
| 参数 |
说明 |
类型 |
可选值 |
默认值 |
| id |
标识 id |
number/string |
—— |
-1 |
| btns |
按钮组 |
array |
—— |
[{ text: ‘删除’, type: ‘delete’ }?] |
| type |
按钮类型 |
string |
—— |
inside |
Events
| 事件名称 |
说明 |
回调参数 |
| start |
滑动开始事件 |
id |
| end |
滑动结束事件 |
id |
| btnClick |
按钮点击事件 |
按钮对象 |
Methods
| 事件名称 |
说明 |
回调参数 |
| resetPos |
重置按钮位置 |
—— |
使用示例
<template> <div class="swipe"> <swipe class="swipe-item" v-for="(v, index) in list" :key="v" @btnClick="onDel(index)"> <div @click="onClick" style="width:200px;border:1px solid red;">123456789</div> </swipe> </div></template><script>import Vue from 'vue'import { PushBar, Swipe } from 'genie-ui'export default{ components: { PushBar, Swipe }, data () { return { list: [0, 1, 2, 3, 4] } }, methods: { onDel (index) { console.log(index) this.list.splice(index, 1) }, onClick () { console.log('im btm') } }}</script><style scoped>.swipe-item{ margin-top: 20px;}</style>