新增分享页,以及BUG修复
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup>
|
||||
import { ref, onMounted } from "vue";
|
||||
import { ref, onMounted, computed } from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
data: {
|
||||
@@ -8,13 +8,16 @@ const props = defineProps({
|
||||
},
|
||||
onRemove: {
|
||||
type: Function,
|
||||
default: () => {},
|
||||
default: null,
|
||||
},
|
||||
});
|
||||
const bowOptions = ref({});
|
||||
const targetOptions = ref({});
|
||||
// 使用插槽自定义右侧按钮为图标,若需要文字按钮可恢复 rightOptions
|
||||
|
||||
// 根据是否传入 onRemove 来决定是否允许左滑
|
||||
const canSwipe = computed(() => typeof props.onRemove === "function");
|
||||
|
||||
const toDetailPage = () => {
|
||||
uni.navigateTo({
|
||||
url: `/pages/point-book-detail?id=${props.data.id}`,
|
||||
@@ -38,12 +41,14 @@ const onSwipeActionClick = () => {
|
||||
|
||||
<template>
|
||||
<uni-swipe-action>
|
||||
<uni-swipe-action-item
|
||||
@change="() => {}"
|
||||
>
|
||||
<template v-slot:right>
|
||||
<uni-swipe-action-item :disabled="!canSwipe" @change="() => {}">
|
||||
<template v-slot:right v-if="canSwipe">
|
||||
<view class="swipe-right" @click="onSwipeActionClick">
|
||||
<image class="swipe-icon" src="../static/delete-white.png" mode="widthFix" />
|
||||
<image
|
||||
class="swipe-icon"
|
||||
src="../static/delete-white.png"
|
||||
mode="widthFix"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
<view class="container" @click="toDetailPage">
|
||||
|
||||
Reference in New Issue
Block a user