diff --git a/templates/index.html b/templates/index.html index 8e7c87a..e177474 100644 --- a/templates/index.html +++ b/templates/index.html @@ -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') {