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
      })
    },
相关推荐
啊哈一半醒9 分钟前
React 核心知识点系统总结:从基础语法到高级 API,一篇文章梳理完整学习路线
javascript·学习·react.js
2401_8784545327 分钟前
HTML和CSS的复习2
前端·css·html
We་ct35 分钟前
吃透现代CSS全技术体系
前端·css·css3·sass·postcss·预处理器
ZC跨境爬虫35 分钟前
跟着 MDN 学 HTML day_11:(语义化容器全站重构+独立CSS拆分+字体合规引入)
前端·css·ui·重构·html·edge浏览器
ZC跨境爬虫38 分钟前
跟着 MDN 学 HTML day_10:(超链接核心语法+路径规则)
前端·css·笔记·ui·html·edge浏览器
GISer_Jing41 分钟前
AI原生前端工程化进阶实践:从流式交互架构到端云协同全链路落地
前端·人工智能·后端·学习
被考核重击44 分钟前
Vue响应式原理(下)
前端·javascript·vue.js
ZC跨境爬虫9 小时前
跟着 MDN 学 HTML day_9:(信件语义标记)
前端·css·笔记·ui·html
前端老石人9 小时前
HTML 字符引用完全指南
开发语言·前端·html
matlab_xiaowang10 小时前
Redux 入门:JavaScript 可预测状态管理库
开发语言·javascript·其他·ecmascript