-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
538 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
<template> | ||
<div></div> | ||
<div class="main-box"></div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
</script> | ||
|
||
<style scoped lang="css"> | ||
.main-box { | ||
width: 400px;; | ||
height: 360px; | ||
background-color: #fff; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,213 @@ | ||
<template> | ||
<div class="main-box"></div> | ||
<div class="main-box"> | ||
<header class="header"> | ||
<div class="select-box"> | ||
<div class="option"> | ||
<input | ||
type="radio" | ||
id="hot" | ||
name="select" | ||
v-model="selectMain" | ||
value="hot" | ||
checked | ||
> | ||
<label for="hot">热门</label> | ||
</div> | ||
<div class="option"> | ||
<input | ||
type="radio" | ||
id="new" | ||
name="select" | ||
v-model="selectMain" | ||
value="new" | ||
> | ||
<label for="new">最新</label> | ||
</div> | ||
<div class="option"> | ||
<input | ||
type="radio" | ||
id="recommend" | ||
name="select" | ||
v-model="selectMain" | ||
value="recommend" | ||
> | ||
<label for="recommend">猜你喜欢</label> | ||
</div> | ||
</div> | ||
<div class="more"> | ||
<i | ||
class="iconfont icon-gengduo-2" | ||
@mouseover="() => { isShowClassify = true }" | ||
@mouseleave="mouseleaveClassifyPop" | ||
></i> | ||
<div class="more-box" v-show="isShowClassify"> | ||
<div> | ||
<input | ||
id="goods" | ||
type="radio" | ||
name="select-classify" | ||
v-model="selectClassify" | ||
value="goods" | ||
checked | ||
> | ||
<label for="goods">商品</label> | ||
</div> | ||
<div> | ||
<input | ||
id="file" | ||
type="radio" | ||
name="select-classify" | ||
v-model="selectClassify" | ||
value="file" | ||
> | ||
<label for="file">文件</label> | ||
</div> | ||
<div> | ||
<input | ||
id="posts" | ||
type="radio" | ||
name="select-classify" | ||
v-model="selectClassify" | ||
value="posts" | ||
> | ||
<label for="posts">帖子</label> | ||
</div> | ||
<div> | ||
<input | ||
id="user" | ||
type="radio" | ||
name="select-classify" | ||
v-model="selectClassify" | ||
value="user" | ||
> | ||
<label for="user">用户</label> | ||
</div> | ||
</div> | ||
</div> | ||
</header> | ||
<section class="section"> | ||
<div v-show="selectMain === 'hot'"> | ||
<ShowRecommend | ||
class="hot" | ||
:classify="selectClassify" | ||
:mainClassify="selectMain" | ||
></ShowRecommend> | ||
</div> | ||
</section> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { ref } from 'vue' | ||
import ShowRecommend from './show-recommend.vue' | ||
const isShowClassify = ref(false) | ||
const selectMain = ref('hot') | ||
const selectClassify = ref('goods') | ||
const mouseleaveClassifyPop = () => { | ||
const popup = document.querySelector('.more-box') as Element | ||
popup.addEventListener('mouseleave', () => { | ||
isShowClassify.value = false | ||
}) | ||
const more = document.querySelector('.more') as Element | ||
more.addEventListener('mouseleave', () => { | ||
isShowClassify.value = false | ||
}) | ||
} | ||
</script> | ||
|
||
<style scoped lang="css"> | ||
.main-box { | ||
width: 740px; | ||
width: 790px; | ||
height: 780px; | ||
background-color: #fff; | ||
display: flex; | ||
flex-direction: column; | ||
.header { | ||
width: 100%; | ||
height: 50px; | ||
padding: 0 10px; | ||
margin-bottom: 10px; | ||
border-bottom: 1px solid #e5e5e583; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
.select-box { | ||
display: flex; | ||
.option { | ||
label { | ||
margin-right: 20px; | ||
cursor: pointer; | ||
user-select: none; | ||
} | ||
input { | ||
display: none; | ||
} | ||
input:checked + label { | ||
color: #275187; | ||
font-weight: 700; | ||
} | ||
} | ||
} | ||
.more { | ||
i { | ||
font-size: 20px; | ||
cursor: pointer; | ||
} | ||
.more-box { | ||
position: absolute; | ||
width: 120px; | ||
height: 120px; | ||
border-radius: 10px; | ||
background-color: #fff; | ||
box-shadow: 0 0 15px 1px #dadada; | ||
padding: 5px; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-around; | ||
div { | ||
width: 100%; | ||
height: 30px; | ||
cursor: pointer; | ||
user-select: none; | ||
padding-left: 10px; | ||
display: flex; | ||
align-items: center; | ||
input { | ||
display: none; | ||
} | ||
input:checked + label { | ||
color: rgb(139, 165, 199); | ||
font-weight: 700; | ||
} | ||
} | ||
div:hover { | ||
background-color: #d7d7d736; | ||
} | ||
} | ||
} | ||
} | ||
.section { | ||
width: 100%; | ||
height: 100%; | ||
.hot { | ||
width: 100%; | ||
height: 720px; | ||
overflow-y: auto; | ||
} | ||
} | ||
} | ||
</style> |
Oops, something went wrong.