hrms-checkin/src/components/PopUp.vue

48 lines
919 B
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,
},
})
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" />
2023-11-24 18:12:56 +07:00
<FormTime :dataById="data" :closePopup="clickClosePopup" />
2023-11-14 17:47:43 +07:00
</q-card>
</q-dialog>
</template>
<style scoped></style>