From 17fee03f6d1b5a3857c50163fd78fc45927afe68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20LeBlanc?= Date: Tue, 5 Nov 2024 17:08:52 -0500 Subject: [PATCH] Backport template too --- .../resources/js/Components/Modal.vue | 77 ++++++++----------- .../resources/js/Components/Modal.vue | 75 ++++++++---------- 2 files changed, 63 insertions(+), 89 deletions(-) diff --git a/stubs/inertia-vue-ts/resources/js/Components/Modal.vue b/stubs/inertia-vue-ts/resources/js/Components/Modal.vue index 00c6e7f7..b4a677ae 100644 --- a/stubs/inertia-vue-ts/resources/js/Components/Modal.vue +++ b/stubs/inertia-vue-ts/resources/js/Components/Modal.vue @@ -1,5 +1,5 @@ + +
+ +
+
+ + + \ No newline at end of file diff --git a/stubs/inertia-vue/resources/js/Components/Modal.vue b/stubs/inertia-vue/resources/js/Components/Modal.vue index d5d87044..9007f1d0 100644 --- a/stubs/inertia-vue/resources/js/Components/Modal.vue +++ b/stubs/inertia-vue/resources/js/Components/Modal.vue @@ -17,15 +17,18 @@ const props = defineProps({ }); 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; + dialog.value?.showModal(); } else { document.body.style.overflow = null; setTimeout(() => { + dialog.value?.close(); showSlot.value = false; }, 200); } @@ -66,49 +69,33 @@ const maxWidthClass = computed(() => { + +
+ +
+
+ + + \ No newline at end of file