Skip to content

Commit

Permalink
feat: pc端增加搜索
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxingyu521 committed Aug 15, 2022
1 parent 6cc589e commit efdffae
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/components/search/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const handleOpenLink = (link: ILink) => {
</script>

<template>
<span class="search" @click="handleOpenSearch"
<span class="search" title="站内搜索" @click="handleOpenSearch"
><i class="fa-search"></i
></span>

Expand Down Expand Up @@ -81,6 +81,7 @@ const handleOpenLink = (link: ILink) => {
justify-content: center;
border-radius: 50%;
font-size: 15px;
cursor: pointer;
&:hover {
background: rgba(255, 255, 255, 0.1);
}
Expand Down
25 changes: 21 additions & 4 deletions src/layout/webstack/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ const sideMenus = props.menus.concat({
<SideNav v-model:isActive="isSideNavActive" :menus="sideMenus" />
<div class="nav-container">
<div class="nav-container__top">
<Search />
</div>
<div class="nav-container__top--mobile">
<Logo />
<div class="nav-container__top-right">
<div class="nav-container__top--mobile-right">
<Search />
<span class="menu" @click="toggleSideNav">
<i class="fa-bars fa-lg" />
Expand Down Expand Up @@ -82,21 +85,35 @@ const sideMenus = props.menus.concat({
}
&__top {
position: absolute;
top: 0;
left: 0;
padding: 20px;
height: 90px;
display: flex;
align-items: center;
width: 100%;
.search {
color: #333;
}
}
&__top--mobile {
position: absolute;
height: 90px;
top: 0;
left: 0;
width: 100%;
background: #2c2e2f;
display: flex;
padding: 0 30px;
justify-content: space-between;
align-items: center;
transition: all 0.5s ease-in-out;
opacity: 0;
display: none;
@media (max-width: 1000px) {
opacity: 1;
display: flex;
}
&-right {
Expand Down

0 comments on commit efdffae

Please sign in to comment.