Skip to content

Commit

Permalink
docs: fix functions navigation, close #1514
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Apr 21, 2022
1 parent 927f47f commit b99c021
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/.vitepress/theme/components/FunctionsList.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
<script setup lang="ts">
import { computed, ref, toRef } from 'vue'
import Fuse from 'fuse.js'
import { useUrlSearchParams } from '@vueuse/core'
import { useEventListener, useUrlSearchParams } from '@vueuse/core'
import { categoryNames, functions } from '../../../../packages/metadata/metadata'
const coreCategories = categoryNames.filter(i => !i.startsWith('@'))
const addonCategories = categoryNames.filter(i => i.startsWith('@'))
const sortMethods = ['category', 'name', 'updated']
useEventListener('click', (e) => {
if (e.target.tagName === 'A')
window.dispatchEvent(new Event('hashchange'))
})
const query = useUrlSearchParams('hash-params', { removeFalsyValues: true })
const search = toRef(query, 'search')
const category = toRef(query, 'category')
Expand Down

0 comments on commit b99c021

Please sign in to comment.