web:InfiniteScroll 无限滚动

InfiniteScroll 无限滚动

分页加载

复制代码
<div class="data-box" v-infinite-scroll="loadMore">
<li v-for='i in dataList'></li>
</div>

form: {
        current: 1,
        size: 10,
        }

loadMore(){
      console.log(this.dataList.length, this.total ,8888)
      if(this.dataList.length >= this.total){
        return
      }
      this.form.current = this.form.current + 1
      this.getDataList()
    },
     getDataList() {
      getList(this.form).then(res => {
        this.dataList = this.dataList.concat(res.result.records)
        console.log(this.dataList,66666)
        this.total = res.result.total
      })
    },
相关推荐
取码网17 小时前
2025最新口红机防篡改版本源码
android·java·javascript
qq_3813385017 小时前
[特殊字符] MonkeyCode AI 核心功能详解
前端
万邦科技Lafite17 小时前
淘宝关键词API接口获取分类商品信息指南
java·前端·数据库·开放api·淘宝开放平台
KevinCyao17 小时前
教育营销短信接口开发实战:培训机构接入营销短信API实现招生信息精准触达
前端
WordPress学习笔记17 小时前
GraceTheme定义“优雅大气”的WordPress主题新标准
前端·wordpress·wordpress主题
雨季mo浅忆17 小时前
2999第二项目梳理
前端·项目梳理
炘爚17 小时前
C++(移动构造、移动赋值、完美转发)
前端·c++
淡忘_cx18 小时前
解决 Vite EACCES 权限错误:从报错到修复的完整指南
前端·vue
We་ct18 小时前
LeetCode 191. 位1的个数:两种解法详解
前端·算法·leetcode·typescript