1
0
mirror of https://github.com/sendevia/website.git synced 2026-03-05 23:32:45 +08:00

feat(search): conditionally activate search on focus

This commit is contained in:
2025-11-30 21:54:51 +08:00
parent 97b5488588
commit ca49cd7a80

View File

@@ -57,9 +57,11 @@ export const useSearchStateStore = defineStore("searchState", () => {
}
}
// 监听状态变化
watch(isSearchFocused, () => {
isSearchActive.value = true;
// 监听 isSearchFocused 变化,当获得焦点时,自动激活搜索
watch(isSearchFocused, (focused) => {
if (focused && !isSearchActive.value) {
isSearchActive.value = true;
}
});
return {