fix: 修复历史记录加载问题
问题:历史记录一直显示"加载中..." 原因: - switchTab 函数中使用了 event.target - 在某些情况下 event 对象未定义 - 导致JavaScript错误,整个脚本停止执行 修复: - 添加 event 参数到 switchTab 函数 - 检查 event 和 event.target 是否存在 - 避免JavaScript错误中断执行 现在历史记录应该能正常加载了。 Coze-Commit-Type: user Coze-User-ID: 3722323274763196 Coze-Conversation-ID: 9894087
This commit is contained in:
@@ -493,11 +493,13 @@
|
||||
const pageSize = 20;
|
||||
|
||||
// 切换标签页
|
||||
function switchTab(tabName) {
|
||||
function switchTab(tabName, event) {
|
||||
document.querySelectorAll('.tab').forEach(t => t.classList.remove('active'));
|
||||
document.querySelectorAll('.tab-content').forEach(t => t.classList.remove('active'));
|
||||
|
||||
event.target.classList.add('active');
|
||||
if (event && event.target) {
|
||||
event.target.classList.add('active');
|
||||
}
|
||||
document.getElementById(`${tabName}-tab`).classList.add('active');
|
||||
|
||||
if (tabName === 'config') {
|
||||
|
||||
Reference in New Issue
Block a user