refactor: add types for emits

This commit is contained in:
Sebin Nyshkim 2023-09-01 12:11:51 +02:00
parent a0b2062137
commit 07bd197c29
2 changed files with 10 additions and 2 deletions

View file

@ -9,8 +9,12 @@ interface Props {
value: number value: number
} }
interface Emits {
(e: 'update:modelValue', value: number[]): void
}
const props = defineProps<Props>() const props = defineProps<Props>()
const emit = defineEmits(['update:modelValue']) const emit = defineEmits<Emits>()
const checked = computed({ const checked = computed({
get() { get() {

View file

@ -7,8 +7,12 @@ interface Props {
name?: string name?: string
} }
interface Emits {
(e: 'update:modelValue', value: boolean): void
}
const props = defineProps<Props>() const props = defineProps<Props>()
const emit = defineEmits(['update:modelValue']) const emit = defineEmits<Emits>()
const checked = computed({ const checked = computed({
get() { get() {