diff --git a/front/src/components/channels/AlbumSelect.vue b/front/src/components/channels/AlbumSelect.vue index 4d24dcde1..4c0000791 100644 --- a/front/src/components/channels/AlbumSelect.vue +++ b/front/src/components/channels/AlbumSelect.vue @@ -5,16 +5,21 @@ import axios from 'axios' import { useVModel } from '@vueuse/core' import { reactive, ref, watch } from 'vue' +interface Emits { + (e: 'update:modelValue', value: string): void +} + interface Props { - modelValue: number + modelValue: string | null channel: Channel | null } +const emit = defineEmits() const props = withDefaults(defineProps(), { + modelValue: null, channel: null }) -const emit = defineEmits(['update:modelValue']) const value = useVModel(props, 'modelValue', emit) const albums = reactive([]) @@ -36,8 +41,7 @@ const fetchData = async () => { isLoading.value = false } -watch(() => props.channel, fetchData) -fetchData() +watch(() => props.channel, fetchData, { immediate: true })