uniapp左滑删除
欢迎使用ay-operate插件
最近有需求为:左滑删除,整理插件代码如下:
1.ay-operate插件
可去uniapp插件市场的操作组件:左滑删除,自定义任意内容插件
页面下载.
属性
属性 | 类型 | 说明 |
---|---|---|
data_transit | Object | 需要传递数据的对象 |
item | Object | 显示对象,可不传参 |
下面是插件的 代码片
.
<template>
<view>
<view class="box-slideLeft" >
<view class="touch-item touch-slideLeft " @touchstart="touchS" @touchmove="touchM" @touchend="touchE" :style="item_show.txtStyle">
<slot />
</view>
<view class="touch-item del-box-touch-slideLeft cf-shuCenter" @click="delItem(item_show)">
<view class="iconfont icon-shanchu"></view>
</view>
</view>
</view>
</template>
<script>
export default {
components: {
},
props: {
//可不传参
item: {
type: Object,
default () {
return {
}
}
},
data_transit: {
type: Object,
default () {
return {
}
}
},
},
computed: {
},
data() {
return {
item_show : {
},
delBtnWidth: 60, //删除按钮宽度单位(rpx)
startX: '',
};
},
created:function(){