细节调整

This commit is contained in:
kron
2025-11-04 17:41:50 +08:00
parent c7ebeaac36
commit 802d21a896
4 changed files with 53 additions and 18 deletions

View File

@@ -13,9 +13,7 @@ const props = defineProps({
});
const bowOptions = ref({});
const targetOptions = ref({});
const rightOptions = [
{ text: "删除", style: { backgroundColor: "#ff4d4f", color: "#fff" } },
];
// 使用插槽自定义右侧按钮为图标,若需要文字按钮可恢复 rightOptions
const toDetailPage = () => {
uni.navigateTo({
@@ -41,9 +39,13 @@ const onSwipeActionClick = () => {
<template>
<uni-swipe-action>
<uni-swipe-action-item
:right-options="rightOptions"
@click="onSwipeActionClick"
@change="() => {}"
>
<template v-slot:right>
<view class="swipe-right" @click="onSwipeActionClick">
<image class="swipe-icon" src="../static/delete-white.png" mode="widthFix" />
</view>
</template>
<view class="container" @click="toDetailPage">
<view class="left-part">
<view class="labels">
@@ -156,4 +158,18 @@ const onSwipeActionClick = () => {
font-size: 30rpx;
color: #fff;
}
/* 右侧滑动按钮(自定义宽度与图标) */
.swipe-right {
width: 120rpx; /* 这里可按需调整按钮宽度 */
height: 100%;
background-color: #ff7c7c;
display: flex;
align-items: center;
justify-content: center;
}
.swipe-icon {
width: 44rpx;
height: 44rpx;
}
</style>