- Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Hi, firstly nice little package thank you.
I created this Modal/Dialog but it comes up with a type error when I use it
<script setup lang="ts"> import { computed, ref } from 'vue' import DialogBox, { type ActionButton } from '#cwa/runtime/templates/components/core/DialogBox.vue' const props = withDefaults(defineProps<{ title: string, content: string }>(), { title: 'No Title Set', content: 'No Content Set' }) const emit = defineEmits(['confirm', 'cancel']) const open = ref(true) const buttons = computed<ActionButton[]>(() => { return [ { label: 'Ok', color: 'blue', buttonClass: 'cwa-min-w-[120px]', callbackFn: () => (emit('confirm')) }, { label: 'Cancel', color: 'grey', callbackFn: () => (emit('cancel')) } ] }) </script> <template> <DialogBox v-model="open" :title="title" :buttons="buttons"> <div v-html="props.content" /> </DialogBox> </template>
It's fine though, it works and I ignore the typescript error - any tips on what needs to change would be good. I think this follows your guide of what needs to be emitted.
I also have functionality on my dialogs for a transition - I'll adjust my page to set open
to false and then emit cancel
after, but I did think it'd be quite nice to just have a configurable delay on closing the dialog.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request