vue-better-scroll实现移动端下拉加载组件

1.下载安装better-scroll

npm i -S better-scroll

1.1安装完成之后,打开pacaage.json文件查看,是否有(better-scroll)

"dependencies": {
    "axios": "^0.19.0",
    //已安装better-scroll
    "better-scroll": "^1.15.2",
    "core-js": "^2.6.5",
    "vue": "^2.6.10",
    "vue-router": "^3.0.3",
    "vuex": "^3.0.1"
  },

2.在components下创建组件Scrooller





2.1在main.js中全局注册Scroller

// scroller全局组件
import Scroller from '@/components/Scroller/Scroller.vue'
Vue.component('Scroller',Scroller);

3.在views中引入Scroller组件


                                       

 

你可能感兴趣的:(vue-better-scroll实现移动端下拉加载组件)