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` -