这次分享的是我这次的项目中的一个功能:Vue+Vant组件库完成列表的加载和下拉刷新,废话不多说直接上代码:
HTML:
<van-empty description="暂无数据"
v-show="recordList.length == 0" />
<van-pull-refresh v-model="isRefreshing"
@refresh="onRefresh">
<van-list v-model:loading="loading"
:finished="finished"
finished-text="没有更多了"
@load="getAllDangers">
<div class="record"
v-for="item in recordList"
:key="item"
:title="item"
@click="toDetails(item)">
<div class="record_title">
<span class="tag"
:style="{ backgroundC