From 6c0f0984524001607c394b9e98b31c7fca18a4d3 Mon Sep 17 00:00:00 2001 From: Paul Elliott Date: Fri, 23 Feb 2024 14:50:52 -0500 Subject: [PATCH] refactor(SaveSegmentGroupDialog): emit event rather than close prop --- src/components/SaveSegmentGroupDialog.vue | 6 ++++-- src/components/SegmentGroupControls.vue | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/SaveSegmentGroupDialog.vue b/src/components/SaveSegmentGroupDialog.vue index 2f9e5d09..e603b459 100644 --- a/src/components/SaveSegmentGroupDialog.vue +++ b/src/components/SaveSegmentGroupDialog.vue @@ -57,9 +57,11 @@ const EXTENSIONS = [ ]; const props = defineProps<{ - close: () => void; id: string; }>(); + +const emit = defineEmits(['done']); + const fileName = ref(''); const valid = ref(true); const saving = ref(false); @@ -79,7 +81,7 @@ async function saveSegmentGroup() { saveAs(new Blob([serialized]), `${fileName.value}.${fileFormat.value}`); }); saving.value = false; - props.close(); + emit('done'); } onMounted(() => { diff --git a/src/components/SegmentGroupControls.vue b/src/components/SegmentGroupControls.vue index eddf6cdd..fef96e10 100644 --- a/src/components/SegmentGroupControls.vue +++ b/src/components/SegmentGroupControls.vue @@ -263,7 +263,7 @@ function openSaveDialog(id: string) {