Updates
This commit is contained in:
rodič
9021acadbd
revize
2e276b2afe
|
@ -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 },
|
||||||
|
|
Načítá se…
Odkázat v novém úkolu