feat:留言板组件封装
This commit is contained in:
parent
be14015565
commit
0f23391c74
|
@ -1,13 +1,12 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="message-wrapper">
|
<view class="message-wrapper">
|
||||||
<u-swipe-action>
|
<u-swipe-action
|
||||||
<u-swipe-action-item
|
|
||||||
:options="swipeOptions"
|
|
||||||
:show="item.show"
|
|
||||||
:index="itemIndex"
|
:index="itemIndex"
|
||||||
|
:show="item.show"
|
||||||
|
:options="swipeOptions"
|
||||||
@click="handleSwipeClick"
|
@click="handleSwipeClick"
|
||||||
@open="(e) => handleSwipeOpen(e)"
|
@open="handleSwipeOpen"
|
||||||
@close="(e) => handleSwipeClose(e)"
|
@close="handleSwipeClose"
|
||||||
@content-click="closeSwipe"
|
@content-click="closeSwipe"
|
||||||
:btn-width="80"
|
:btn-width="80"
|
||||||
:disabled="false"
|
:disabled="false"
|
||||||
|
@ -60,8 +59,7 @@
|
||||||
<text>回复</text>
|
<text>回复</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view></u-swipe-action-item
|
</view>
|
||||||
>
|
|
||||||
</u-swipe-action>
|
</u-swipe-action>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
@ -100,15 +98,18 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
handleSwipeClick(e) {
|
handleSwipeClick(e) {
|
||||||
const { index } = e; // 点击的按钮索引
|
const { index } = e; // 点击的按钮索引
|
||||||
|
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
// 删除按钮
|
// 删除按钮
|
||||||
this.$emit("delete", this.itemIndex);
|
this.$emit("delete", this.itemIndex);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleSwipeOpen(e) {
|
handleSwipeOpen(e) {
|
||||||
|
// uView 1.x的事件参数格式与2.x不同
|
||||||
this.$emit("open-swipe", this.itemIndex);
|
this.$emit("open-swipe", this.itemIndex);
|
||||||
},
|
},
|
||||||
handleSwipeClose(e) {
|
handleSwipeClose(e) {
|
||||||
|
// uView 1.x的事件参数格式与2.x不同
|
||||||
this.item.show = false;
|
this.item.show = false;
|
||||||
},
|
},
|
||||||
closeSwipe() {
|
closeSwipe() {
|
||||||
|
|
Loading…
Reference in New Issue