better-scroll scroll plug

installation:

npm install better-scroll --save

  

html structure:

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

  

The introduction and use of:

import BScroll '@ better-scroll / core' // references from 
the let document.querySelector warpper = ( '. warpper') // Get DOM 
the let Scroll = new new BScroll (warpper) // Create instance

  

Guess you like

Origin www.cnblogs.com/xuwupiaomiao/p/12152156.html