From e1955e8a0363bb0a8947dc324e046ec378c6e529 Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Thu, 2 May 2024 17:49:54 +0800 Subject: [PATCH] fix: back to top percentage issue #72 --- theme/src/client/components/BackToTop.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/theme/src/client/components/BackToTop.vue b/theme/src/client/components/BackToTop.vue index 3d0a4fb7..ab0cd1f3 100644 --- a/theme/src/client/components/BackToTop.vue +++ b/theme/src/client/components/BackToTop.vue @@ -19,7 +19,9 @@ const isScrolling = ref(false) const progress = computed( () => (y.value / (bodyHeight.value - windowHeight.value)) * 100, ) -const percent = computed(() => `${Math.round(progress.value) || 0}%`) + +// #72 back to top percentage issue +const percent = computed(() => `${Math.min(Math.round(progress.value), 100) || 0}%`) const stroke = computed(() => `calc(${Math.PI * progress.value}% - ${4 * Math.PI}px) calc(${Math.PI * 100}% - ${4 * Math.PI}px)`,