mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-13 09:28:14 +08:00
fix(parser): 微调样式,优化回顶组件
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
// 点击回到顶部
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user