Mint UI组件Loadmore上拉加载一些问题以及使用

本文主要探讨了Mint UI中Loadmore组件在页面初始化时出现的请求接口两次的问题,以及如何通过设置auto-fill属性为false来解决。同时,文章详细讨论了在iOS设备上遇到的上拉加载失效的两个兼容性问题及其解决方案。
摘要由CSDN通过智能技术生成
  1. 页面初始化会请求两次接口
    添加属性:auto-fill=“false”
  2. 兼容ios上拉加载失效1
(滚动的父元素添加样式)
.view {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  1. 兼容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"
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值