局部滚动触底加载
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
|
||||
<p class="all_test">全部考试</p>
|
||||
<div class="card_list" v-if="testList.length">
|
||||
<scroll-view :style="{height: height + 'px'}" scroll-y>
|
||||
<scroll-view :style="{height: height + 'px'}" scroll-y @scrolltolower="scrolltLower">
|
||||
<div class="card" v-for="item in testList" :key="item.id">
|
||||
<div class="card_top">
|
||||
<div class="card_title">{{ item.examinationName }}</div>
|
||||
@@ -97,7 +97,7 @@ export default {
|
||||
}
|
||||
}).then(res=> {
|
||||
if(res?.data) {
|
||||
this.testList = res.data.records
|
||||
this.testList = this.current==1? res.data.records: [...this.testList,...res.data.records]
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -153,12 +153,12 @@ export default {
|
||||
this.showAuth = false
|
||||
this.$u.toast(err.msg)
|
||||
})
|
||||
},
|
||||
scrolltLower() {
|
||||
this.current++
|
||||
this.getList()
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
this.current++;
|
||||
this.getList()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user