🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# 判断是否懒加载 this.sleepNewDataSync(el) 判断是否已经懒加载结束,返回新加载数据高度(配和滑动实现循环下滑) | 参数名 | 类型 | 必填 | 说明| | --- | --- |--- | --- | | el| string| 是 | 元素的ID(#元素的id)或者元素的class(.+元素的class) | ### 示例 ``` <div class="demo0">我是节点0</div> <div id="demo1" style="width: 100%; height: 1000px; background-color: antiquewhite;">我是节点1</div> <div class="demo0">我是底部</div> async mounted() { let res = await this.sleepNewDataSync('#demo0') } ``` #判断是否懒加载 this.sleepNewDataSync(object) 等待节点出现后自动滑到节点的最底部,实现获取界面的懒加载 | 参数名 | 类型 | 必填 | 说明| | --- | --- |--- | --- | | el| string| 是 | 元素的ID(#元素的id)或者元素的class(.+元素的class) | | success | function| 是 | 成功返回 | success返回参数说明 | 参数名 | 类型 | 说明| | --- | --- |--- | --- | | res | object | 新增加元素的高度 | ### 示例 ``` <div class="demo0">我是节点0</div> <div id="demo1" style="width: 100%; height: 1000px; background-color: antiquewhite;">我是节点1</div> <div class="demo0">我是底部</div> async mounted() { this.sleepNewData({ el : '.demo0', success : (res) => { console.log(res) } }) } ```