vue移动端滚动插件BetterScroll

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

原生滚动github

.hello {
    overflow-y: scroll;
  }

BetterScroll
ide

<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 方法和事件code

相关文章
相关标签/搜索