当前位置: 首页 > Web前端 > HTML5

Vue加载多,上拉刷新VueScroller简化思维

时间:2023-04-06 00:17:36 HTML5

今天给大家分享vue上拉刷新,加载更多组件使用VueScroller第一步安装:npminstallvue-scroller-D第二部分是配置主要。jsimportVueScrollerfrom'vue-scroller'Vue.use(VueScroller)第三部分开始使用//contentjs部分如下methods:{//拉起加载infinite:function(){console.log('infinite')this.timeout=setTimeout(()=>{if(this.myData.length>=20){this.$refs.my_scroller.finishInfinite(true);}else{this.$refs.my_scroller.finishInfinite(false);}}//this.$refs.my_scroller.resize();//弃用,this.myData.push(this.myData[1]);},1500)},//下拉刷新refresh:function(){console.log('refresh')this.timeout=setTimeout(()=>{this.$refs.my_scroller.finishPullToRefresh()},1500)}}