hrms-checkin/src/components/PopUp.vue

56 lines
1 KiB
Vue
Raw Normal View History

2023-11-14 17:47:43 +07:00
<script setup lang="ts">
import { ref, watch } from 'vue'
2023-11-14 17:47:43 +07:00
import HeaderPopup from '@/components/HeaderPopup.vue'
import FormTime from '@/components/FormTime.vue'
const props = defineProps({
modal: {
type: Boolean,
default: false,
},
title: {
type: String,
default: '',
},
clickClose: {
type: Function,
default: null,
},
dataById: {
type: Object,
default: null,
},
fetcthDataTable: {
type: Function,
require: true,
},
2023-11-14 17:47:43 +07:00
})
const data = ref<any>()
function clickClosePopup() {
props.clickClose()
}
watch(
() => props.modal,
() => {
data.value = props.modal ? props.dataById : null
2023-11-14 17:47:43 +07:00
}
)
2023-11-14 17:47:43 +07:00
</script>
<template>
2023-11-14 18:01:22 +07:00
<q-dialog v-model="props.modal">
<q-card class="column" style="width: 300px; min-height: 600px">
2023-11-14 17:47:43 +07:00
<HeaderPopup :title="props.title" :clickClose="clickClosePopup" />
<FormTime
:dataById="data"
:closePopup="clickClosePopup"
:fetcthDataTable="props.fetcthDataTable"
/>
2023-11-14 17:47:43 +07:00
</q-card>
</q-dialog>
</template>
<style scoped></style>