diff --git a/docs/.vitepress/components/BodyScrollbar.vue b/docs/.vitepress/components/BodyScrollbar.vue index bb2e46c..c9f245c 100644 --- a/docs/.vitepress/components/BodyScrollbar.vue +++ b/docs/.vitepress/components/BodyScrollbar.vue @@ -4,21 +4,9 @@ import { useEventListener, useWindowScroll, useWindowSize, - useStyleTag, } from '@vueuse/core'; import { computed, onMounted, shallowRef, type CSSProperties } from 'vue'; -useStyleTag( - ` -body::-webkit-scrollbar { - display: none; -} -html { - scrollbar-width: none; -} -`.trim(), -); - const { y, x } = useWindowScroll(); const { height: winH, width: winW } = useWindowSize(); const bodyRef = shallowRef(); // support ssr @@ -180,3 +168,11 @@ useEventListener('selectstart', (e) => { + diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts index bc1fbc5..41aa826 100644 --- a/docs/.vitepress/theme/index.ts +++ b/docs/.vitepress/theme/index.ts @@ -45,6 +45,10 @@ const ScrollbarWrapper = defineComponent(() => { onMounted(() => { const isMobile = 'ontouchstart' in document.documentElement; show.value = !isMobile; + if (isMobile) { + document.body.classList.add('mobile'); + document.documentElement.classList.add('mobile'); + } }); return () => { return show.value