Skip to content

Commit e66b2ee

Browse files
committed
fix: BodyScrollbar errorDistance
1 parent 54ac7b3 commit e66b2ee

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/.vitepress/components/BodyScrollbar.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ onMounted(() => {
1515
});
1616
const body = useElementBounding(bodyRef);
1717
18-
const yShow = computed(() => body.height.value > winH.value);
18+
const errorDistance = 5;
19+
20+
const yShow = computed(() => body.height.value > winH.value + errorDistance);
1921
const yHeight = computed(() => {
2022
const clientHeight = body.height.value;
2123
const bodyHeight = clientHeight;
@@ -63,7 +65,7 @@ useEventListener('pointerup', () => {
6365
yDragging.value = false;
6466
});
6567
66-
const xShow = computed(() => body.width.value > winW.value);
68+
const xShow = computed(() => body.width.value > winW.value + errorDistance);
6769
const xWidth = computed(() => {
6870
const clientWidth = body.width.value;
6971
const bodyWidth = clientWidth;

0 commit comments

Comments
 (0)