debug(frontend): 添加导航组件详细日志,便于问题排查

- 增加 mounted 生命周期日志
- 增加 installNavigation 和样式注入日志
- 在各页面注入运行态调试代码
- 优化 installNavigation 容错(fallback 直接注册)
- 添加最小测试页 test-minimal.html
This commit is contained in:
lt
2026-05-08 11:37:32 +08:00
parent ef168e3d90
commit beb2cf2473
6 changed files with 99 additions and 111 deletions
+13 -1
View File
@@ -397,8 +397,20 @@ const app = createApp({
app.use(ElementPlus);
// 安装导航组件
if (window.installNavigation) { window.installNavigation(app); }
if (window.installNavigation) { window.installNavigation(app); } else if (window.NavigationComponent) { app.component("navigation-component", window.NavigationComponent); }
app.mount('#app');
// 调试代码:检查导航组件状态
setTimeout(() => {
const hasNav = !!document.querySelector('.navigation-wrapper');
const hasSidebar = !!document.querySelector('.navigation-wrapper .sidebar');
console.log('[调试] 导航wrapper:', hasNav);
console.log('[调试] 侧边栏:', hasSidebar);
if (!hasNav) {
console.error('[调试] 导航组件未渲染!window.NavigationComponent=', !!window.NavigationComponent);
console.error('[调试] app实例是否存在组件注册?', Vue && Vue.app && Vue.app._context.components['navigation-component']);
}
}, 100);
</script>
</body>
</html>