feat(优化性能): 减少搜索界面重复刷新,提升字体匹配性能
build.yaml / build (push) Successful in 37s

This commit is contained in:
xiaoqidun committed 2026-09-13 19:23:20 +08:00
1 parent 9bde9eec64
commit 2b2e83bdbe
2 files changed
+37 -17

No files matched your search

+5 -2
View File
@@ -2074,10 +2074,13 @@ async function searchDocument() {
if (seq !== state.searchSeq || openSeq !== state.openSeq) {
return;
}
for (const match of matches || []) {
el.searchStatus.textContent = `正在搜索 ${page + 1} / ${pageCount} 页`;
if (!matches?.length) {
continue;
}
for (const match of matches) {
state.searchMatches.push({ ...match, page });
}
el.searchStatus.textContent = `正在搜索 ${page + 1} / ${pageCount} 页`;
renderSearchResults();
}
el.searchStatus.textContent = state.searchMatches.length ? "搜索完成" : "暂无结果";