feat:留言板组件封装

This commit is contained in:
JiXinHui 2025-07-10 09:09:05 +08:00
parent be14015565
commit 0f23391c74
1 changed files with 56 additions and 55 deletions

View File

@ -1,13 +1,12 @@
<template>
<view class="message-wrapper">
<u-swipe-action>
<u-swipe-action-item
:options="swipeOptions"
:show="item.show"
<u-swipe-action
:index="itemIndex"
:show="item.show"
:options="swipeOptions"
@click="handleSwipeClick"
@open="(e) => handleSwipeOpen(e)"
@close="(e) => handleSwipeClose(e)"
@open="handleSwipeOpen"
@close="handleSwipeClose"
@content-click="closeSwipe"
:btn-width="80"
:disabled="false"
@ -60,8 +59,7 @@
<text>回复</text>
</view>
</view>
</view></u-swipe-action-item
>
</view>
</u-swipe-action>
</view>
</template>
@ -100,15 +98,18 @@ export default {
methods: {
handleSwipeClick(e) {
const { index } = e; //
if (index === 0) {
//
this.$emit("delete", this.itemIndex);
}
},
handleSwipeOpen(e) {
// uView 1.x2.x
this.$emit("open-swipe", this.itemIndex);
},
handleSwipeClose(e) {
// uView 1.x2.x
this.item.show = false;
},
closeSwipe() {