feat: 在头部组件和菜单组件中添加发帖功能,并优化首页搜索标题样式

This commit is contained in:
CH-122
2025-08-15 10:37:51 +08:00
parent 5ff098ea21
commit ba073b71a6
3 changed files with 31 additions and 18 deletions

View File

@@ -24,6 +24,16 @@
<div v-if="isMobile" class="search-icon" @click="search">
<i class="fas fa-search"></i>
</div>
<ToolTip
content="发帖"
placement="bottom"
>
<div class="new-post-icon" @click="goToNewPost">
<i class="fas fa-edit"></i>
</div>
</ToolTip>
<DropdownMenu ref="userMenu" :items="headerMenuItems">
<template #trigger>
<div class="avatar-container">
@@ -113,6 +123,10 @@ const goToLogout = () => {
navigateTo('/login', { replace: true })
}
const goToNewPost = () => {
navigateTo('/new-post', { replace: false })
}
const headerMenuItems = computed(() => [
{ text: '设置', onClick: goToSettings },
{ text: '个人主页', onClick: goToProfile },
@@ -275,6 +289,11 @@ onMounted(async () => {
cursor: pointer;
}
.new-post-icon {
font-size: 18px;
cursor: pointer;
}
@media (max-width: 1200px) {
.header-content {
padding-left: 15px;