fix: 修复搜索内容为空时,却显示高亮的问题

This commit is contained in:
刘洪洪
2024-06-06 10:59:41 +08:00
parent db54deadbf
commit 026781515c

View File

@@ -1427,7 +1427,7 @@ export const myHighLight = {
const newText = text.replace(regex, (match) => {
// 将value中的value提取出来对比string即精准搜索fullText模糊搜索
for (const item of value) {
if ((item.type === columnType.string && item.value === el.innerHTML) || el.className.indexOf('high-location') > -1) {
if ((item.value && item.type === columnType.string && item.value === el.innerHTML) || el.className.indexOf('high-location') > -1) {
if (el.className.indexOf('high-light-block') > -1) {
return `<span class="highlight__block">${match}</span>`
} else {