fix: 调整搜索界面样式
- 调整相关组件大小 - 调整文字显示逻辑
This commit is contained in:
@ -38,17 +38,18 @@
|
||||
|
||||
<!-- 右侧功能区 -->
|
||||
<div class="header-actions">
|
||||
<el-input
|
||||
v-model="searchQuery"
|
||||
class="search-input"
|
||||
:placeholder="$t('search-placeholder')"
|
||||
:prefix-icon="Search"
|
||||
clearable
|
||||
@keyup.enter="handleSearch"
|
||||
/>
|
||||
<el-link
|
||||
class="search-link"
|
||||
:underline="false"
|
||||
type="info"
|
||||
@click="navigateTo(localePath('/search'))"
|
||||
>
|
||||
<el-icon class="action-icon"><ElIconSearch /></el-icon>
|
||||
</el-link>
|
||||
|
||||
<el-dropdown @command="setLocale">
|
||||
<el-link type="info" :underline="false">
|
||||
<el-icon class="mdi mdi-translate translate-link" />
|
||||
<el-icon class="mdi mdi-translate action-icon" />
|
||||
</el-link>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
@ -62,29 +63,13 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Search } from '@element-plus/icons-vue';
|
||||
|
||||
const router = useRouter();
|
||||
const localePath = useLocalePath();
|
||||
|
||||
const { setLocale } = useI18n();
|
||||
|
||||
const searchQuery = ref('');
|
||||
|
||||
const activeName = ref<string | undefined>(undefined);
|
||||
|
||||
const handleSearch = () => {
|
||||
const trimmed = searchQuery.value.trim();
|
||||
if (!trimmed) return;
|
||||
navigateTo({
|
||||
path: localePath('/search'),
|
||||
query: {
|
||||
query: trimmed,
|
||||
},
|
||||
});
|
||||
searchQuery.value = '';
|
||||
};
|
||||
|
||||
const refreshMenu = () => {
|
||||
const path = router.currentRoute.value.path;
|
||||
if (path.startsWith('/productions')) {
|
||||
@ -170,11 +155,7 @@
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.translate-link {
|
||||
font-size: 20px;
|
||||
.action-icon {
|
||||
font-size: 24px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user