- 页面初始化会请求两次接口
添加属性:auto-fill=“false” - 兼容ios上拉加载失效1
(滚动的父元素添加样式)
.view {
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
- 兼容ios上拉加载失效2
<div ref='wrapper' :style="{height: iSiPhone? wrapperHeight + 'px' : ''}" :class="[iSiPhone?'iSiPhoneI':'iSiPhoneA']">
// style="-webkit-overflow-scrolling: touch; overflow: scroll;"
<mt-loadmore :bottom-method="loadBottom" :bottom-all-loaded="bottomAllLoaded" ref="loadmore" :auto-fill="false" > </mt-loadmore>
</div>
data(){
return{
wrapperHeight:'',
iSiPhone: ''
}
}
mounted(){
// 判断安卓还是ios
this.iSiPhone = navigator.userAgent.includes('iPhone')
if(this.iSiPhone) {
this.wrapperHeight = document.documentElement.clientHeight - this.$refs.wrapper.getBoundingClientRect().top;
} else {
return false
}
},
上拉加载的使用
<mt-loadmore :bottom-method="loadBottom" :bottom-all-loaded="bottomAllLoaded" ref="loadmore"