This commit is contained in:
tree 2022-04-26 04:59:59 +02:00
rodič 9021acadbd
revize 2e276b2afe
1 změnil soubory, kde provedl 4 přidání a 3 odebrání

Zobrazit soubor

@ -99,9 +99,10 @@
} }
if (f.type === 'text') { if (f.type === 'text') {
const sr = fuse.search(f.key) const sr = fuse.search(f.key)
console.log(sr)
if (sr.length > 0) { if (sr.length > 0) {
arr = sr.map(sr => arr.find(i => i.id === sr.item.id)) arr = sr.map(sr => arr.find(i => i.id === sr.item.id)).filter(sr => sr)
} else {
arr = []
} }
} }
} }
@ -112,7 +113,7 @@
bundle.subscribe(bd => { bundle.subscribe(bd => {
fuse = new Fuse(bd.spec.events, { fuse = new Fuse(bd.spec.events, {
includeScore: true, includeScore: true,
minMatchCharLength: 3, minMatchCharLength: 1,
threshold: 0.4, threshold: 0.4,
keys: [ keys: [
{ name: 'name', weight: 10 }, { name: 'name', weight: 10 },