美文网首页
简洁易用的/渐进式的 vue 移动端滚动组件

简洁易用的/渐进式的 vue 移动端滚动组件

作者: 酒暖花深Q | 来源:发表于2020-07-18 18:54 被阅读0次

了解一下 better-scroll 可以在GitHub上面搜索。他是 isScroll 的封装,但是使用起来更加友好

链接地址:https://github.com/ustbhuangyi/better-scroll

vue项目里面安装

npm install better-scroll --save

Css里面的样式 最外层父集盒子使页面不能滚动

 .wrapper {
     overflow hidden
     position absolute
     top 0
     bottom 0
     left 0
     right 0
}

注意它的Dom结构

<div class="wrapper">
  <ul class="content">
    <li>...</li>
    <li>...</li>
    ...
  </ul>
  <!-- you can put some other DOMs here, it won't affect the scrolling-->
</div>

相关文章

网友评论

      本文标题:简洁易用的/渐进式的 vue 移动端滚动组件

      本文链接:https://www.haomeiwen.com/subject/gdpfkktx.html