From 725da078afc3398f49f1efdc25bc82b9ec1dac35 Mon Sep 17 00:00:00 2001 From: DYL0109 <dn18191638832@163.com> Date: 星期三, 16 四月 2025 19:27:30 +0800 Subject: [PATCH] Merge pull request #64 from zhitan-cloud/develop1.0 --- zhitan-vue/src/components/Breadcrumb/index.vue | 33 ++++++++++++++------------------- 1 files changed, 14 insertions(+), 19 deletions(-) diff --git a/zhitan-vue/src/components/Breadcrumb/index.vue b/zhitan-vue/src/components/Breadcrumb/index.vue index 032a6fb..4637888 100644 --- a/zhitan-vue/src/components/Breadcrumb/index.vue +++ b/zhitan-vue/src/components/Breadcrumb/index.vue @@ -19,20 +19,29 @@ let matched = route.matched.filter(item => item.meta && item.meta.title); const first = matched[0] - // 涓嶈嚜鍔ㄦ坊鍔犻椤靛埌闈㈠寘灞戜腑 - // if (!isDashboard(first)) { - // matched = [{ path: '/index', meta: { title: '棣栭〉' } }].concat(matched) - // } + // 娣诲姞璋冭瘯鏃ュ織 + console.log('Current route path:', route.path); + console.log('Route matched:', route.matched); + console.log('Filtered matched routes:', matched); + + // 濡傛灉鏄椤电湅鏉胯矾鐢憋紝纭繚瀹冭娣诲姞鍒伴潰鍖呭睉涓� + if (route.path === '/index' || route.path === '/index/index') { + matched = [{ path: '/index', meta: { title: '棣栭〉鐪嬫澘' } }].concat(matched) + console.log('Added index route to matched:', matched); + } levelList.value = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false) + console.log('Final breadcrumb items:', levelList.value); } + function isDashboard(route) { const name = route && route.name if (!name) { return false } - return name.trim() === 'Index' + return name.trim().toLowerCase() === 'index' } + function handleLink(item) { const { redirect, path } = item if (redirect) { @@ -62,20 +71,6 @@ .no-redirect { color: #fff; cursor: text; - } - - :deep(.el-breadcrumb__item) { - .el-breadcrumb__inner { - color: rgba(255, 255, 255, 0.8); - - &:hover { - color: #fff; - } - } - - .el-breadcrumb__separator { - color: rgba(255, 255, 255, 0.8); - } } } </style> \ No newline at end of file -- Gitblit v1.9.3