安装:

npm install better-scroll --save

  

html结构:

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

  

引入及使用:

import BScroll from '@better-scroll/core'  //引用
let wrapper = document.querySelector('.wrapper') //获取dom
let scroll = new BScroll(wrapper)   //创建实例

  

相关文章:

  • 2022-12-23
  • 2021-06-08
  • 2022-01-23
  • 2022-12-23
  • 2021-08-12
  • 2021-08-18
  • 2022-01-22
  • 2022-01-16
猜你喜欢
  • 2021-11-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-05
  • 2022-12-23
  • 2021-09-07
相关资源
相似解决方案