You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

75 lines
1.2 KiB

<template>
<view class="">
<uni-swipe-action ref="swipeAction" >
<uni-swipe-action-item
:right-options="options" @click="swipeClick($event, index)">
<view class="">
推荐:{{dataContent.code}}
</view>
<view class="">
推荐:{{dataContent.patch}}
</view>
<view class="">
推荐:{{dataContent.locatioCode}}
</view>
</uni-swipe-action-item>
<slot></slot>
</uni-swipe-action>
</view>
</template>
<script>
export default {
data() {
return {
options: [
{
text: '编辑',
style: {
backgroundColor: 'rgb(254,156,1)'
}
},
{
text: '删除',
style: {
backgroundColor: 'rgb(255,58,49)'
}
}
]
}
},
props: {
dataContent: {
type: Object,
default: {}
},
index:{
type:Number,
default:0
}
},
methods:{
swipeClick(e,index) {
console.log("点击",e.content.text)
console.log("点击",index)
if (e.content.text === '删除') {
uni.showToast({
title: `点击了删除按钮`+index,
icon: 'none'
});
} else {
uni.showToast({
title: `点击了${e.content.text}按钮`+index,
icon: 'none'
});
}
}
}
}
</script>
<style>
</style>