Feature: 解决方案列表 & 网页字体

This commit is contained in:
2025-08-22 10:58:04 +08:00
parent e9b6409144
commit 3d858e475e
20 changed files with 233 additions and 35 deletions

View File

@ -8,7 +8,9 @@
<!-- 导航菜单 -->
<el-menu :default-active="activeName" class="header-menu" mode="horizontal" :ellipsis="false" :persistent="false" router>
<el-menu
:default-active="activeName" class="header-menu" mode="horizontal" :ellipsis="false"
:persistent="false" router>
<el-menu-item index="productions" :route="$localePath('/productions')">
<span class="title">{{ $t('navigation.productions') }}</span>
</el-menu-item>
@ -52,7 +54,7 @@ const { setLocale } = useI18n();
const searchQuery = ref('')
const activeName = ref('')
const activeName = ref<string | undefined>(undefined)
const handleSearch = () => {
if (searchQuery.value.trim()) {
@ -63,7 +65,7 @@ const handleSearch = () => {
}
}
onMounted(() => {
const refreshMenu = () => {
const path = router.currentRoute.value.path;
if (path.startsWith('/productions')) {
activeName.value = 'productions';
@ -74,9 +76,16 @@ onMounted(() => {
} else if (path.startsWith('/about')) {
activeName.value = 'about';
} else {
activeName.value = '';
activeName.value = undefined; // 默认不激活任何菜单项
}
console.log('Current path:', path, 'Active menu:', activeName.value);
}
onMounted(() => {
refreshMenu();
// 监听路由变化以更新激活状态
router.afterEach(() => {
refreshMenu();
});
})
</script>
@ -85,14 +94,16 @@ onMounted(() => {
margin: 0 auto;
padding: 0 10px;
display: flex;
height: 80px;
align-items: center;
/* border-bottom: 1px solid #e0e0e0; */
border-bottom: 1px solid #e0e0e0;
}
.logo-section {
display: flex;
flex: 1;
align-items: center;
margin-left: 20px;
}
.logo-link {
@ -102,7 +113,7 @@ onMounted(() => {
}
.website-logo {
height: 80px;
height: 64px;
width: auto;
}
@ -110,6 +121,7 @@ onMounted(() => {
margin-right: 40px;
border-bottom: none !important;
width: auto;
--el-menu-horizontal-height: 100%;
}
.header-menu .el-menu-item {