fix: 更新 sProgress 逻辑以支持多个路径

Co-authored-by: xudeyu444 <xudeyu444@users.noreply.github.com>
This commit is contained in:
2025-06-02 21:02:26 +08:00
parent b0e79cc35f
commit 08646fe984

View File

@@ -5,7 +5,7 @@ import Button from "primevue/button";
const path = computed(() => { const path = computed(() => {
return useRoute().path; return useRoute().path;
}); });
const sProgress = ref(path.value === "/" ? 1 : 0); const sProgress = ref(["/", "/download"].includes(path.value) ? 1 : 0);
const scrollPanel = useTemplateRef<ComponentPublicInstance>("scrollPanel"); const scrollPanel = useTemplateRef<ComponentPublicInstance>("scrollPanel");
const sX = ref(0); const sX = ref(0);
const sY = ref(0); const sY = ref(0);
@@ -24,7 +24,7 @@ const handleScrollOrResize = () => {
sWidth.value = el.getBoundingClientRect().width; sWidth.value = el.getBoundingClientRect().width;
sHeight.value = el.getBoundingClientRect().height; sHeight.value = el.getBoundingClientRect().height;
} }
if (path.value !== "/") { if (!["/", "/download"].includes(path.value)) {
sProgress.value = 0; sProgress.value = 0;
return; return;
} }