feat: 简化导航栏滚动动画逻辑,统一不同页面行为

This commit is contained in:
2025-06-10 21:01:43 +08:00
parent a138a893d2
commit 66425218aa

View File

@@ -7,9 +7,7 @@ const appConfig = useAppConfig();
const path = computed(() => {
return useRoute().path;
});
const sProgress = ref(
["/", "/download", "/download/"].includes(path.value) ? 1 : 0
);
const sProgress = ref(1);
const scrollPanel = useTemplateRef<ComponentPublicInstance>("scrollPanel");
const sX = ref(0);
const sY = ref(0);
@@ -28,10 +26,6 @@ const handleScrollOrResize = () => {
sWidth.value = el.getBoundingClientRect().width;
sHeight.value = el.getBoundingClientRect().height;
}
if (!["/", "/download", "/download/"].includes(path.value)) {
sProgress.value = 0;
return;
}
const scrollTop = (scrollPanel.value as unknown as { lastScrollTop: number })
.lastScrollTop;
const clientHeight = scrollPanel.value?.$el.clientHeight;