Skip to content

Commit

Permalink
fix: router navigation, close #303, close #300, close #301
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Apr 8, 2024
1 parent d164a65 commit b44e2a9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
1 change: 0 additions & 1 deletion src/components/IconDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ const collection = computed(() => {
<RouterLink
class="ml-1 text-gray-600 hover:text-gray-700 dark:text-gray-300 dark:hover:text-gray-200"
:to="`/collection/${collection.id}`"
@click="$emit('close')"
>
{{ collection.name }}
</RouterLink>
Expand Down
4 changes: 1 addition & 3 deletions src/components/IconSet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,7 @@ function focusSearch() {
onMounted(focusSearch)
watch(router.currentRoute, focusSearch, { immediate: true })

router.afterEach((to) => {
if (to.path === '/')
search.value = ''
router.afterEach(() => {
focusSearch()
})

Expand Down
8 changes: 0 additions & 8 deletions src/hooks/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,6 @@ export function useSearch(collection: Ref<CollectionMeta | null>) {
debouncedSearch()
})

watch(
collection,
() => {
category.value = ''
variant.value = ''
},
)

return {
collection,
search,
Expand Down

0 comments on commit b44e2a9

Please sign in to comment.