vue移动端滚动插件BetterScroll

源码地址
https://github.com/ustbhuangyi/better-scroll.git

原生滚动

  .hello {
    overflow-y: scroll;
  }

BetterScroll

<script>
  import BetterScroll from 'better-scroll'

  export default {
    name: 'HelloWorld',
    mounted() {
      let bs = new BetterScroll('.hello', {

      })
    }
  }
</script>
<style scoped>
  .hello {
    overflow-y: hidden;
    background-color: antiquewhite;
    height: 200px;
  }
</style>

它不仅支持惯性滚动、边界回弹、滚动条淡入淡出等效果的灵活配置,让滚动更加流畅,同时还提供了很多 API 方法和事件

posted @ 2021-07-20 11:00  thomas_blog  阅读(335)  评论(0编辑  收藏  举报