Skip to content

Commit ea7f807

Browse files
luizhf42gustavosbarreto
authored andcommitted
feat(ui): make BaseDialog emit a @close
1 parent a42d719 commit ea7f807

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ui/src/components/BaseDialog.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<template>
22
<v-dialog
33
v-model="showDialog"
4+
@update:model-value="handleModelValueChange"
45
:fullscreen
56
:max-width
67
>
@@ -24,10 +25,13 @@ const props = defineProps<{
2425
forceFullscreen?: boolean
2526
}>();
2627
28+
const emit = defineEmits(["close"]);
2729
const showDialog = defineModel<boolean>({ required: true });
2830
const { smAndDown, thresholds } = useDisplay();
2931
const fullscreen = computed(() => props.forceFullscreen || smAndDown.value);
3032
const maxWidth = computed(() => fullscreen.value ? undefined : thresholds.value[props.threshold || "sm"]);
3133
34+
const handleModelValueChange = (value: boolean) => { if (!value) emit("close"); };
35+
3236
defineExpose({ fullscreen, maxWidth });
3337
</script>

0 commit comments

Comments
 (0)