From 05bf5e9456675b9163a0ba6315d236d2c4111bef Mon Sep 17 00:00:00 2001 From: chenjiajian <770230504@qq.com> Date: Wed, 22 Mar 2023 15:33:11 +0800 Subject: [PATCH] fix --- src/scroll/index.js | 78 +++++++++++++++++++++++++++++++++------------ 1 file changed, 57 insertions(+), 21 deletions(-) diff --git a/src/scroll/index.js b/src/scroll/index.js index 07ba7c2..4293eef 100644 --- a/src/scroll/index.js +++ b/src/scroll/index.js @@ -17,16 +17,19 @@ class Scroll extends Component { css` :host { position: relative; - overflow: auto; + overflow: hidden; display: block; + } + .scroller { + position: relative; + height: 100%; + width: 100%; + overflow: auto; &::-webkit-scrollbar { display: none; } scrollbar-width: none; //火狐专属 } - .scroll { - position: relative; - } .scroll-bar { position: absolute; background: #909399; @@ -73,11 +76,34 @@ class Scroll extends Component { } ` ] - + get scrollTop() { + return this.$refs.scroller.scrollTop + } + set scrollTop(val) { + this.$refs.scroller.scrollTop = val + } + get scrollHeight() { + return this.$refs.scroller.scrollHeight + } + set scrollHeight(val) { + this.$refs.scroller.scrollHeight = val + } + get scrollLeft() { + return this.$refs.scroller.scrollLeft + } + set scrollLeft(val) { + this.$refs.scroller.scrollLeft = val + } + get scrollWidth() { + return this.$refs.scroller.scrollWidth + } + set scrollWidth(val) { + this.$refs.scroller.scrollWidth = val + } render() { return html` -