File tree Expand file tree Collapse file tree
docs/.vuepress/components/Demo Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,21 +52,29 @@ import Fuse from '../../../../dist/fuse.esm.js'
5252import Books from ' ./books.js'
5353import MonacoEditor from ' ./MonacoEditor.vue'
5454
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-
6255const 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+ })
6371
6472let codify = () => {
6573 return `
6674const Fuse = require('fuse.js');
6775
6876const fuseOptions = {
69- ${possibleFuseKeys . map ((key ) => ` \t // ${key }: ${Fuse . config [ key ] },` ).join (' \n ' )}
77+ ${Object . entries ( fuseSearchOptions ). map (([ key , value ] ) => ` \t // ${key }: ${value },` ).join (' \n ' )}
7078\t keys: [
7179\t\t "title",
7280\t\t "author.firstName"
You can’t perform that action at this time.
0 commit comments