better-scroll 滾動插件


安裝:

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)   //創建實例

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM