diff --git a/package/component/src/component/scroll/index.less b/package/component/src/component/scroll/index.less new file mode 100644 index 00000000..62cb2a55 --- /dev/null +++ b/package/component/src/component/scroll/index.less @@ -0,0 +1,44 @@ +.scrollbar-box { + height: 100%; + overflow: hidden !important; +} + +.scrollbar-y { + position: relative; + height: 100%; + .scroll-wrap { + height: 100%; + overflow-y: scroll; + scrollbar-width: none; /* firefox */ + -ms-overflow-style: none; + } + + .scrollbar-track { + position: absolute; + top: 0; + right: 0; + bottom: 0; + border-radius: 8px; + z-index: 20; + .scrollbar-thumb { + margin: 0 auto; + border-radius: 6px; + cursor: default; + } + } +} +.scrollbar-y ::-webkit-scrollbar { + display: none; +} +//移动端隐藏自定义滚动条 +.hide.scrollbar-box .scrollbar-track { + display: none; +} +//移动端显示原生滑块 +.hide.scrollbar-box .scrollbar-y ::-webkit-scrollbar { + display: block; +} +.hide.scrollbar-box .scrollbar-y .scroll-wrap { + scrollbar-width: auto; + -ms-overflow-style: scrollbar; +} diff --git a/package/component/src/component/scroll/index.vue b/package/component/src/component/scroll/index.vue index da97e75b..cea5f1d9 100644 --- a/package/component/src/component/scroll/index.vue +++ b/package/component/src/component/scroll/index.vue @@ -35,6 +35,7 @@ - + \ No newline at end of file diff --git a/package/component/src/resolver/index.ts b/package/component/src/resolver/index.ts index 2a86f7dd..95008fd9 100644 --- a/package/component/src/resolver/index.ts +++ b/package/component/src/resolver/index.ts @@ -83,6 +83,10 @@ const matchComponents = [ pattern: /^LayBreadcrumbItem$/, styleDir: "breadcrumb", }, + { + pattern: /^LayScroll$/, + styleDir: "scroll", + }, // .... { pattern: /^(LayCarousel|LayCarouselItem)$/, @@ -130,10 +134,6 @@ const matchComponents = [ pattern: /^LayRadio$/, styleDir: "", }, - { - pattern: /^LayScroll$/, - styleDir: "", - }, { pattern: /^LaySelectOption$/, styleDir: "select",