diff --git a/app/components/TopNav.vue b/app/components/TopNav.vue index eb2f4e3..c1bf97a 100644 --- a/app/components/TopNav.vue +++ b/app/components/TopNav.vue @@ -4,7 +4,6 @@ const fontReady = ref(false) const navHidden = ref(false) const route = useRoute() -const router = useRouter() const { loggedIn, user, clear, initialized } = useAuthSession() @@ -13,22 +12,6 @@ const links: any = [ { to: "/test", label: "测试" }, ] -const searchQuery = ref((route.query.q as string) ?? '') -const searchFocused = ref(false) - -function onSearchSubmit() { - const q = searchQuery.value.trim() - if (!q) return - router.push({ path: '/', query: { q } }) -} - -// When input is cleared, remove the query param -watch(searchQuery, (val) => { - if (!val.trim() && route.query.q) { - router.replace({ path: '/', query: {} }) - } -}) - let lastScrollY = 0 const HIDE_OFFSET = 520 @@ -58,10 +41,6 @@ watch(() => route.path, () => { menuOpen.value = false }) -// Sync search input from URL -watch(() => route.query.q, (val) => { - searchQuery.value = (val as string) ?? '' -})