美文网首页
Antd Select数据懒加载

Antd Select数据懒加载

作者: J_SQ | 来源:发表于2020-08-19 09:54 被阅读0次
           <a-select
                placeholder="请选择"
                v-model=""
                style="width: 100%"
                @popupScroll="scrollMore"//滚动触发的方法
                @change="selectedSet"
              >
              <a-select-option></a-select-option>
           </a-select>
       scrollMore(e) {
          const { target } = e
          var total = target.scrollTop + target.offsetHeight
          var scrollHeight = target.scrollHeight
          console.log('total:' + total)
          console.log('scrollHeight:' + scrollHeight)
          console.log('-------重要的是下面的判断条件↓--------------------------------')
          #this.scrollPage是当前页 this.totalCount是总条数
          if (total >= scrollHeight - 1 && total < scrollHeight + 1 && this.scrollPage < 
          this.totalCount ) {
              this.scrollPage = this.scrollPage + 1
              this.getCompanyList() // 调用api方法
            }
        }
      getCompanyList(value) {}
    

    相关文章

      网友评论

          本文标题:Antd Select数据懒加载

          本文链接:https://www.haomeiwen.com/subject/vfykjktx.html