Merge pull request #261

* Supplementary search, Resolve the issue of language not being supported
This commit is contained in:
Jackxwb
2024-10-12 22:33:04 +08:00
committed by GitHub
parent 65b247573e
commit 888973e2cb

View File

@@ -156,11 +156,26 @@
const matches = index.value.search("*" + search.value + "*");
let resultIDs = []
for (let i = 0; i < matches.length; i++) {
const match = matches[i];
const item = props.items[parseInt(match.ref)];
const display = extractDisplay(item);
list.push({ id: i, display, value: item });
resultIDs.push(item.id);
}
/**
* Supplementary search,
* Resolve the issue of language not being supported
*/
for (let i = 0; i < props.items.length; i++) {
const item = props.items[i]
if(resultIDs.find(item_ => item_ === item.id) != undefined){continue}
if(item.treeString.indexOf(search.value) > -1){
const display = extractDisplay(item);
list.push({ id: i, display, value: item });
}
}
return list;