File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed
docs/.vuepress/components/Demo Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -52,21 +52,29 @@ import Fuse from '../../../../dist/fuse.esm.js'
52
52
import Books from ' ./books.js'
53
53
import MonacoEditor from ' ./MonacoEditor.vue'
54
54
55
- let possibleFuseKeys: string [] = []
56
- for (const key in Fuse .config ) {
57
- if (typeof Fuse .config [key ] != ' function' && key !== ' keys' ) {
58
- possibleFuseKeys .push (key )
59
- }
60
- }
61
-
62
55
const searchPattern = ref (' ' )
56
+ const fuseSearchOptions = ref ({
57
+ isCaseSensitive: false ,
58
+ includeScore: false ,
59
+ shouldSort: true ,
60
+ includeMatches: false ,
61
+ findAllMatches: false ,
62
+ minMatchCharLength: 1 ,
63
+ location: 0 ,
64
+ threshold: 0.6 ,
65
+ distance: 100 ,
66
+ useExtendedSearch: false ,
67
+ ignoreLocation: false ,
68
+ ignoreFieldNorm: false ,
69
+ fieldNormWeight: 1
70
+ })
63
71
64
72
let codify = () => {
65
73
return `
66
74
const Fuse = require('fuse.js');
67
75
68
76
const fuseOptions = {
69
- ${possibleFuseKeys . map ((key ) => ` \t // ${key }: ${Fuse . config [ key ] },` ).join (' \n ' )}
77
+ ${Object . entries ( fuseSearchOptions ). map (([ key , value ] ) => ` \t // ${key }: ${value },` ).join (' \n ' )}
70
78
\t keys: [
71
79
\t\t "title",
72
80
\t\t "author.firstName"
You can’t perform that action at this time.
0 commit comments