Feature: 添加Layout布局

This commit is contained in:
2025-08-14 13:30:32 +08:00
parent 3e32e0f59b
commit 2fa89460eb
5 changed files with 39 additions and 15 deletions

View File

@ -1,5 +1,7 @@
<template>
<div>
<NuxtPage />
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</div>
</template>

View File

@ -7,32 +7,32 @@
<!-- 导航菜单 -->
<el-menu default-active="productions" class="header-menu" mode="horizontal" :ellipsis="false" router>
<el-menu-item index="/productions">
<span class="title">产品中心</span>
<span class="title">{{ $t('productions') }}</span>
</el-menu-item>
<el-menu-item index="/solutions">
<span class="title">解决方案</span>
<span class="title">{{ $t('solutions') }}</span>
</el-menu-item>
<el-menu-item index="/support">
<span class="title">服务支持</span>
<span class="title">{{ $t('support') }}</span>
</el-menu-item>
<el-menu-item index="/about">
<span class="title">关于我们</span>
<span class="title">{{ $t('about-us') }}</span>
</el-menu-item>
</el-menu>
<!-- 右侧功能区 -->
<div class="header-actions">
<el-input
v-model="searchQuery" class="search-input" placeholder="搜索..." :prefix-icon="Search" clearable
@keyup.enter="handleSearch" />
<el-dropdown>
v-model="searchQuery" class="search-input" :placeholder="$t('search-placeholder')"
:prefix-icon="Search" clearable @keyup.enter="handleSearch" />
<el-dropdown @command="setLocale">
<el-link type="info" :underline="false">
<el-icon class="mdi mdi-translate translate-link" />
</el-link>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item>中文</el-dropdown-item>
<el-dropdown-item>English</el-dropdown-item>
<el-dropdown-item command="zh">中文</el-dropdown-item>
<el-dropdown-item command="en">English</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
@ -43,6 +43,8 @@ v-model="searchQuery" class="search-input" placeholder="搜索..." :prefix-icon=
<script setup lang="ts">
import { Search } from '@element-plus/icons-vue';
const { setLocale } = useI18n();
const searchQuery = ref('')
const handleSearch = () => {
@ -98,4 +100,4 @@ const handleSearch = () => {
.translate-link {
font-size: 20px;
}
</style>
</style>

10
app/layouts/default.vue Normal file
View File

@ -0,0 +1,10 @@
<template>
<el-container>
<el-header>
<jinshen-header />
</el-header>
<el-main>
<slot />
</el-main>
</el-container>
</template>