1.什么是better-scroll
better-scroll是一个滚动插件,旨在解决移动端的滚动环境(已经支持PC)。是对iscroll的封装
github地址 https://github.com/ustbhuangyi/better-scroll
2.下载
npm install better-scroll --save
3.引入
在需要页面引入
import Bscroll from 'better-scroll'
4.在vue中的使用

better-scroll需要获取DOM,在vue中使用ref获取到需要的DOM,一般在生命周期钩子的mounted函数中使用


网友评论