- ปรับ dialog รับ v-model

- เพิ่มคำแนะนำตอนส่ง process ของเลื่อนเงินเดือน
This commit is contained in:
Warunee Tamkoo 2024-03-08 17:49:08 +07:00
parent d09f09cada
commit 4471912ffb
10 changed files with 86 additions and 100 deletions

View file

@ -3,11 +3,12 @@ import { ref, watch } from "vue";
import DialogHeader from "@/components/DialogHeader.vue";
const reason = ref<string | undefined>("");
const modal = defineModel<boolean>("modal", { required: true });
const props = defineProps({
modal: {
type: Boolean,
default: false,
},
// modal: {
// type: Boolean,
// default: false,
// },
title: {
type: String,
default: "",
@ -16,10 +17,10 @@ const props = defineProps({
type: String,
default: "",
},
clickClose: {
type: Function,
default: () => {},
},
// clickClose: {
// type: Function,
// default: () => {},
// },
savaForm: {
type: Function,
default: () => {},
@ -29,7 +30,7 @@ const props = defineProps({
},
});
watch(props, () => {
if (props.modal === true && props.textReport == "") {
if (modal.value === true && props.textReport == "") {
reason.value = "";
} else {
reason.value = props.textReport;
@ -44,13 +45,17 @@ const submit = () => {
}
});
};
function closeModal() {
modal.value = false
}
</script>
<template>
<q-dialog v-model="props.modal" persistent>
<q-dialog v-model="modal" persistent>
<q-card style="width: 40vw; max-width: 40vw">
<q-form ref="myForm">
<DialogHeader :tittle="props.title" :close="clickClose" />
<DialogHeader :tittle="props.title" :close="closeModal" />
<q-separator />
<q-card-section class="q-pa-sm bg-grey-1">
<div class="row col-12 q-col-gutter-sm">