注意:以下文档只适用于TOP接口,请谨慎使用!

文档中心 > 天猫精灵IoT开放平台

Swipe 滑动删除

更新时间:2019/02/11 访问次数:951

参数


参数 说明 类型 可选值 默认值
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>

FAQ

关于此文档暂时还没有FAQ
返回
顶部