fix(parser): 微调样式,优化回顶组件

This commit is contained in:
BTMuli
2023-04-02 18:15:16 +08:00
parent 9d756b8d96
commit 18fa5521d6
2 changed files with 8 additions and 1 deletions

View File

@@ -15,7 +15,14 @@ const canTop = ref(false); //默认不显示
// 监听滚动事件
function handleScroll() {
scrollTop.value = document.documentElement.scrollTop || document.body.scrollTop;
// 超过500px显示回到顶部按钮
canTop.value = scrollTop.value > 500;
// 没超过500但是到底部了也显示回到顶部按钮
if (!canTop.value) {
const scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
const clientHeight = document.documentElement.clientHeight || document.body.clientHeight;
canTop.value = scrollHeight - clientHeight - scrollTop.value <= 0;
}
}
// 点击回到顶部

View File

@@ -124,7 +124,6 @@ onMounted(async () => {
activity: activityCard,
game: newsCard,
};
console.log(annoCards.value);
tab.value = "activity";
loading.value = false;
});
@@ -166,6 +165,7 @@ async function toJson(item: AnnoListCard) {
border-radius: 10px;
background: #faf7e8;
color: #546d8b;
border-bottom: #4b5366 1px solid;
}
.anno-cover {