Skip to content

Commit

Permalink
feat: search with query
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 committed Jan 24, 2024
1 parent c63025c commit 7919fdc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { Input } from '@/components/ui/input';
import { Button } from '@/components/ui/button';
import { Skeleton } from '@/components/ui/skeleton';
const route = useRoute();
const results = ref<Detail[]>();
const searchInput = ref('');
Expand All @@ -24,6 +26,11 @@ const search = async () => {
isSearching.value = false;
}
};
if (route.query.q) {
searchInput.value = route.query.q as string;
await search();
}
</script>

<template>
Expand Down

0 comments on commit 7919fdc

Please sign in to comment.