use prop function createTag instead of event to make sure it is handled by the parent

This commit is contained in:
Gregor Vostrak
2024-07-15 18:19:04 +02:00
parent 655723db49
commit 1e4f0afa67
14 changed files with 60 additions and 71 deletions

View File

@@ -7,7 +7,6 @@ import type { Tag } from '@/utils/api';
const emit = defineEmits<{
changed: [];
createTag: [name: string, callback: (tag: Tag) => void];
}>();
const model = defineModel({
@@ -22,12 +21,13 @@ const iconColorClasses = computed(() => {
});
defineProps<{
tags: Tag[];
createTag: (name: string) => Promise<Tag | undefined>;
}>();
</script>
<template>
<TagDropdown
@createTag="(...args) => $emit('createTag', ...args)"
:createTag
@changed="emit('changed')"
v-model="model"
:tags="tags">