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
      })
    },
相关推荐
前端小D15 小时前
React Native项目开发(iOS侧为例)
javascript·react native·react.js
xixingzhe215 小时前
本地桌面客户端入门开发
前端
不磕了还不行15 小时前
用 Vue + Element UI 把元宝搜索的返回值做成“能点开检查的证据卡片”
前端·vue.js·ui
Csvn1 天前
WASM
前端
修己xj1 天前
我用 AI 给自己写了一个 Markdown 编辑器,然后把它开源了
前端
FRing031 天前
vue2干货总结2(v-bind、v-for、v-model、指令修饰符、v-bind操作class和style)
开发语言·前端·vue.js·vue2
幸运小猿1 天前
模拟慢上传-处理超时重试image 丢失线上问题
前端·javascript·html
moshuying1 天前
网购能买Token了!
前端
h_65432101 天前
echarts实现柱状图加一条横线
前端·echarts
风骏时光牛马1 天前
生成一个后端标题,只需要一个标题,不需要其他的任何文本。
前端