Vant中List列表下拉加载更多

简介: Vant中List列表下拉加载更多

van-list上只有一层父级元素div,多了可能下拉加载出不来;或者更多


<template>
    <div class="scholl-declarepage">
        <van-list
            v-model="loading"
            :finished="finished"
            finished-text="没有更多了"
            @load="onLoad"
            :immediate-check="cheack"
            >
                <swipe-cell
                custom
                class="bootom-having-border"
                :isEdit="isEdit"
                v-for="(item,index) in listAchool" :key="index"
                @edit="detior(item)"
                @remove="delItem(item)"
                >
                    <scholl-list-com :listObj="item" @gotodetails="gotodetails(item)"></scholl-list-com>
                </swipe-cell>
            </van-list>  
    </div>
</template>


loading: false,
finished: false,
 cheack:true,
paramsList:{
  orgId: "",
  pageIndex: 0,
  pageSize: 10 
},
listAchool:[],
 onLoad(){
  this.paramsList.pageIndex+=1;
   this.schoolListContApi();//列表渲染
},
   schoolListContApi(){
                this.paramsList.orgId=this.userInfo.orgId,
                schoolListCont(this.paramsList).then(res=>{
                    console.log(res);
                    if(res.success==true){
                        this.loading = false;// 这一次的加载状态结束 
                        this.listAchool=this.listAchool.concat(res.data); 
                       if(res.data.length==0 || this.listAchool.length>=res.totalDatas){
                            this.finished = true;//所有的数据已经全部加载完了
                        }else{
                            this.finished = false;
                        }
                    }else{
                        this.finished = false;
                    }
                })
            },  
 // 删除请求
commendDelApi(item){
  let params={
    id:item.id
  }
  schoolDelCont(params).then(res=>{
    if(res.success==true){
      this.paramsList.pageIndex=1;//重新赋值
      this.listAchool=[];
      this.schoolListContApi();
    }   
  })
},
相关文章
|
16天前
|
XML JavaScript 数据格式
DOM 节点列表长度(Node List Length)
`length`属性用于获取DOM节点列表的元素数量。在示例中,代码加载&quot;books.xml&quot;,然后通过`getElementsByTagName(&quot;title&quot;)`获取所有标题节点。使用`for`循环遍历这些节点,输出每个标题的文本内容。这个例子展示了如何交互式地处理XML文档中的特定标签。
|
20天前
|
JavaScript
DOM 节点列表长度(Node List Length)
`length`属性用于获取DOM节点列表的元素数量。通过遍历这个属性,如`for (i=0;i&lt;x.length;i++)`,可以访问和处理每个节点。在示例中,代码加载&quot;books.xml&quot;,然后获取所有&quot;title&quot;标签,并打印它们的子节点值。
|
24天前
|
JavaScript
DOM 节点列表长度(Node List Length)
`length`属性用于获取DOM节点列表的长度。在示例中,代码加载&quot;books.xml&quot;,然后使用`getElementsByTagName(&quot;title&quot;)`获取所有标题节点。通过循环`x.length`,遍历并输出每个标题节点的第一个子节点的值。
|
4天前
|
JavaScript
DOM 节点列表长度(Node List Length)
`length`属性用于获取DOM节点列表的元素数量。通过它,可以迭代列表,如示例所示:加载&quot;books.xml&quot;,然后获取所有&quot;title&quot;节点。循环`x.length`,打印每个标题节点的第一个子节点的值。
|
10天前
|
JavaScript
DOM 节点列表长度(Node List Length)
`length`属性用于获取DOM节点列表的元素数量。通过遍历这个属性,如`for (i=0; i&lt;x.length; i++)`,可以访问和处理每个节点。在示例中,代码加载&quot;books.xml&quot;,然后获取所有&quot;title&quot;节点,并打印它们的第一个子节点的值。
|
11天前
|
XML JavaScript 数据格式
DOM 节点列表长度(Node List Length)
`length`属性用于获取DOM节点列表的长度,即节点数量。通过它可遍历列表,如`for(i=0; i&lt;x.length; i++)`循环访问每个`title`节点,并输出其内容。示例展示了从&quot;books.xml&quot;加载XML后,获取并打印所有标题节点的值。
|
19小时前
|
JavaScript
DOM 节点列表长度(Node List Length)
`length`属性用于获取DOM节点列表的元素数量。在示例中,代码加载&quot;books.xml&quot;,然后通过`getElementsByTagName(&quot;title&quot;)`获取所有标题节点。使用`for`循环遍历这些节点,输出每个标题的文本内容。
|
21小时前
|
存储 Dart
Dart中的集合类型:List(数组/列表)
Dart中的集合类型:List(数组/列表)
6 0
|
22天前
|
存储 NoSQL 安全
Redis第六弹-List列表-(相当于数组/顺序表)Lpush key element-一次可以插入多个元素(假如key已经存在,并且key对应的value并非是list,则会报错)
Redis第六弹-List列表-(相当于数组/顺序表)Lpush key element-一次可以插入多个元素(假如key已经存在,并且key对应的value并非是list,则会报错)
|
24天前
|
BI
Power BI获取SharePoint List列表后,如何展开List/Table中的字段,以及使用逗号拼接为一个字符串
在Power BI中,从SharePoint List获取数据时遇到Table和List混合的数据源,直接展开会导致“笛卡尔积”效应,生成过多行。目标是保持行数不变,将Table中的字段与List值用逗号分隔显示在同一行。解决方法包括:1) 添加新列,从Table中提取List的Column2值;2) 使用Text.Combine函数合并List中的值。具体操作步骤包括选择列并自定义新列,然后展开List并以逗号分隔。通过这些步骤,可以将Table转换为所需的字符串格式。完整的Power BI Query代码展示了这一过程。参考链接提供了更多详情。