思路
页面结构
van-tabs在最上面
van-pull-refresh在van-tabs下面
van-list在van-pull-refresh里面
css关键
给van-pull-refresh设置高度为calc(100% - 44px), 其中44px是van-tabs的高度,
同时给van-pull-refresh设置
overflow: hidden;
overflow-y: scroll;
这样就能滚动起来加载更多
效果展示
以下是正文
html
<div class="AlarmList">
<van-tabs v-model="active" color="RGBA(4, 131, 247, 1)" title-active-color="#000"
@change="onRefresh">
<van-tab v-for="(item,index) in tabList" :key="index" :title="item.title" :name="item.name">
</van-tab>
</van-tabs>
<van-pull-refresh :style="{height:'calc(100% - 44px)'}" v-model="isRefresh"
@refresh="onRefresh" ref="pullRefresh" immediate-check="false">
<van-empty v-if="dataList.length == 0" description="暂无数据" />
<van-list ref="list" class="list" v-model="loadingMore" :finished=