This repository was archived by the owner on Jan 6, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 22import { rpc } from ' ../logic/rpc'
33import type { DocumentInfo } from ' ../../types'
44import { data } from ' ../logic/documentations'
5+ import { useFuse } from ' @vueuse/integrations/useFuse'
56
67const rawItems = data
78const items = ref (data )
@@ -21,9 +22,12 @@ function navigate(data: DocumentInfo) {
2122}
2223
2324const keywords = ref (' ' )
25+ const { results : filterDocuments } = useFuse (keywords , rawItems .map (i => i .name ), {
26+ matchAllWhenSearchEmpty: true
27+ })
2428
25- watch (keywords , () => {
26- items .value = rawItems .filter (item => packagesName . includes (item .id ) && ( item . id . includes (keywords . value ) || keywords . value . length === 0 ))
29+ watch (filterDocuments , () => {
30+ items .value = rawItems .filter (item => ( filterDocuments . value . map ( i => i . item ). includes (item .name ) && packagesName . includes (item . id ) ))
2731})
2832
2933function back() {
@@ -39,10 +43,8 @@ function back() {
3943 <div v-if =" iframeViewUrl" >
4044 <IframeView :src =" iframeViewUrl" />
4145 <teleport to =" body" >
42- <span
43- fixed left-2 top-2 z-1000 h-8 w-8 flex cursor-pointer select-none items-center justify-center rounded-5
44- bg-base hover =" text-primary" @click.prevent.stop =" back"
45- >
46+ <span fixed left-2 top-2 z-1000 h-8 w-8 flex cursor-pointer select-none items-center justify-center rounded-5
47+ bg-base hover =" text-primary" @click.prevent.stop =" back" >
4648 <i tabler:arrow-back-up />
4749 </span >
4850 </teleport >
Original file line number Diff line number Diff line change @@ -105,8 +105,8 @@ export interface DocumentInfo {
105105 website : string
106106 github : string
107107 icon : string
108- tips : string
109- openInBlank : boolean
108+ tips ? : string
109+ openInBlank ? : boolean
110110}
111111
112112export interface PackageInfo {
You can’t perform that action at this time.
0 commit comments