From f4b1234893b66172377fb1bb57c36940ca08cbb9 Mon Sep 17 00:00:00 2001 From: sight <1453017105@qq.com> Date: Fri, 8 Apr 2022 16:16:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(scroll):=20=E6=BB=9A=E5=8A=A8=E6=9D=A1?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/src/component/scroll/index.vue | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/package/component/src/component/scroll/index.vue b/package/component/src/component/scroll/index.vue index 2a9ac35e..2453afa8 100644 --- a/package/component/src/component/scroll/index.vue +++ b/package/component/src/component/scroll/index.vue @@ -238,20 +238,16 @@ export default defineComponent({ overflow: hidden !important; } -.scrollbar-box ::-webkit-scrollbar { - width: 0px !important; -} - .scrollbar-y { position: relative; height: 100%; .scroll-wrap { height: 100%; overflow-y: scroll; - scrollbar-color: transparent transparent; - scrollbar-track-color: transparent; - -ms-scrollbar-track-color: transparent; + scrollbar-width: none; /* firefox */ + -ms-overflow-style: none; } + .scrollbar-track { position: absolute; top: 0; @@ -266,12 +262,19 @@ export default defineComponent({ } } } +.scrollbar-y ::-webkit-scrollbar{ + display: none; +} //移动端隐藏自定义滚动条 .hide.scrollbar-box .scrollbar-track { display: none; } //移动端显示原生滑块 -.hide.scrollbar-box .scrollbar-y { - margin: 0; +.hide.scrollbar-box .scrollbar-y ::-webkit-scrollbar{ + display: block; +} +.hide.scrollbar-box .scrollbar-y .scroll-wrap{ + scrollbar-width: auto; + -ms-overflow-style: scrollbar; }