1
0
mirror of https://gitee.com/bookshelfplus/bookshelfplus synced 2025-09-03 23:52:51 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

表格渲染考虑无满足条件传入提示字符串的情况

This commit is contained in:
2022-03-15 23:31:48 +08:00
parent 80a5b59bdf
commit 4ceb7578b8
2 changed files with 10 additions and 10 deletions

View File

@@ -52,8 +52,12 @@ function renderTable({
}
theadHtml += "</tr>";
}
} else if (typeof data === "string") {
// 是文字 (一般用于未查到结果,显示提示信息)
theadHtml += `<tr><th>${data}</th></tr>`;
} else {
throw new DOMException("Failed to render table: data is not array or dictionary.");
throw new DOMException("Failed to render table: data is not array, dictionary or string.");
}
// 获取table