diff --git a/webui/src/components/ab-search-bar.vue b/webui/src/components/ab-search-bar.vue index 66c7b2dc..65b642c5 100644 --- a/webui/src/components/ab-search-bar.vue +++ b/webui/src/components/ab-search-bar.vue @@ -2,8 +2,17 @@ import {ref} from 'vue'; import {vOnClickOutside} from "@vueuse/components"; +defineEmits(['add-bangumi']); const showProvider = ref(false); -const {providers, getProviders, provider, loading, onSearch} = useSearchStore(); +const { + providers, + getProviders, + provider, + loading, + onSearch, + inputValue, + bangumiList, +} = useSearchStore(); onMounted(() => { getProviders(); @@ -18,6 +27,7 @@ function onSelect(site: string) { \ No newline at end of file diff --git a/webui/src/components/basic/ab-search.vue b/webui/src/components/basic/ab-search.vue index e9678637..9314fed4 100644 --- a/webui/src/components/basic/ab-search.vue +++ b/webui/src/components/basic/ab-search.vue @@ -16,9 +16,9 @@ withDefaults( defineEmits(['select', 'search']); -const inputValue = ref(''); +const inputValue = defineModel('inputValue'); -watch (inputValue, (val) => { +watch(inputValue, (val) => { console.log(val); }); @@ -44,7 +44,7 @@ watch (inputValue, (val) => { fill="#fff" is-btn btn-click - @click="$emit('search', inputValue)" + @click="$emit('search')" /> @@ -53,7 +53,7 @@ watch (inputValue, (val) => { type="text" :placeholder="$t('topbar.search.placeholder')" input-reset - @keyup.enter="$emit('search', inputValue)" + @keyup.enter="$emit('search')" />