diff --git a/stubs/inertia-vue-ts/resources/js/Components/Modal.vue b/stubs/inertia-vue-ts/resources/js/Components/Modal.vue index 3f65db87..0e96a368 100644 --- a/stubs/inertia-vue-ts/resources/js/Components/Modal.vue +++ b/stubs/inertia-vue-ts/resources/js/Components/Modal.vue @@ -18,21 +18,24 @@ const emit = defineEmits(['close']); const dialog = ref(); const showSlot = ref(props.show); -watch(() => props.show, () => { - if (props.show) { - document.body.style.overflow = 'hidden'; - showSlot.value = true; +watch( + () => props.show, + () => { + if (props.show) { + document.body.style.overflow = 'hidden'; + showSlot.value = true; - dialog.value?.showModal(); - } else { - document.body.style.overflow = ''; + dialog.value?.showModal(); + } else { + document.body.style.overflow = ''; - setTimeout(() => { - dialog.value?.close(); - showSlot.value = false; - }, 200); - } -}); + setTimeout(() => { + dialog.value?.close(); + showSlot.value = false; + }, 200); + } + }, +); const close = () => { if (props.closeable) { @@ -60,18 +63,24 @@ onUnmounted(() => { const maxWidthClass = computed(() => { return { - 'sm': 'sm:max-w-sm', - 'md': 'sm:max-w-md', - 'lg': 'sm:max-w-lg', - 'xl': 'sm:max-w-xl', + sm: 'sm:max-w-sm', + md: 'sm:max-w-md', + lg: 'sm:max-w-lg', + xl: 'sm:max-w-xl', '2xl': 'sm:max-w-2xl', }[props.maxWidth]; });