fix: issues
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
|
||||
<van-back-top bottom="80" />
|
||||
|
||||
<van-list style="padding-bottom: 3em" v-model:loading="loading" :finished="finished" finished-text="没有更多了"
|
||||
offset="100" @load="loadData">
|
||||
<van-list style="padding-bottom: 3em" v-model:loading="loading" :finished="finished"
|
||||
:finished-text="bought ? '您还没有购买' : '没有更多了'" offset="100" @load="loadData">
|
||||
<list-item-card v-for="item in items" :key="item" :item="item" :bought="bought" />
|
||||
</van-list>
|
||||
</template>
|
||||
@@ -55,16 +55,17 @@ export default defineComponent({
|
||||
return;
|
||||
}
|
||||
|
||||
if (res.data.length < pageLimit.value) {
|
||||
finished.value = true;
|
||||
}
|
||||
|
||||
if (offset.value == "") {
|
||||
items.value = res.data;
|
||||
} else {
|
||||
items.value = items.value.concat(res.data);
|
||||
}
|
||||
offset.value = res.data[res.data.length - 1].hash;
|
||||
offset.value = res.data[res.data.length - 1]?.hash;
|
||||
|
||||
if (res.data.length < pageLimit.value) {
|
||||
finished.value = true;
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error("ERROR", err);
|
||||
|
||||
Reference in New Issue
Block a user