fix แก้เงื่อนไขการแสดงปุ่มแก้ไข

This commit is contained in:
Net 2024-06-24 09:44:00 +07:00
parent 848f35e47e
commit 1be8bba799

View file

@ -2,7 +2,8 @@
import { ref } from 'vue'; import { ref } from 'vue';
import AppBox from './app/AppBox.vue'; import AppBox from './app/AppBox.vue';
defineProps<{ withDefaults(
defineProps<{
title: string; title: string;
category?: string; category?: string;
isEdit?: boolean; isEdit?: boolean;
@ -11,12 +12,17 @@ defineProps<{
badgeLabel?: string; badgeLabel?: string;
badgeClass?: string; badgeClass?: string;
bgColor?: string; bgColor?: string;
showEdit?: boolean;
editData?: (...args: unknown[]) => void; editData?: (...args: unknown[]) => void;
deleteData?: (...args: unknown[]) => void; deleteData?: (...args: unknown[]) => void;
submit?: (...args: unknown[]) => void; submit?: (...args: unknown[]) => void;
close?: (...args: unknown[]) => void; close?: (...args: unknown[]) => void;
undo?: (...args: unknown[]) => void; undo?: (...args: unknown[]) => void;
}>(); }>(),
{
showEdit: true,
},
);
const drawerOpen = defineModel<boolean>('drawerOpen', { const drawerOpen = defineModel<boolean>('drawerOpen', {
default: false, default: false,
@ -62,6 +68,7 @@ function reset() {
style="padding: 0; border-radius: var(--radius-2)" style="padding: 0; border-radius: var(--radius-2)"
> >
<div class="form-header col q-px-lg row items-center"> <div class="form-header col q-px-lg row items-center">
<div v-if="showEdit">
<div v-if="isEdit" class="row"> <div v-if="isEdit" class="row">
<q-btn <q-btn
round round
@ -99,6 +106,7 @@ function reset() {
@click="deleteData" @click="deleteData"
/> />
</div> </div>
</div>
<div class="col text-weight-bold text-center"> <div class="col text-weight-bold text-center">
<text <text