新增loadmore组件

This commit is contained in:
TOP糯米 2023-02-21 00:54:49 +08:00
parent e4eb31d5c3
commit 06b801ed25
1 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,51 @@
<template>
<view class="loadmore">
<view class="text" v-if="!hasMore" @click="loadmore">
<text>我已经到底了~</text>
</view>
</view>
</template>
<script>
export default {
name: "widgets-loadmore",
data() {
return {
page: 1,
};
},
props: {
hasMore: {
type: Boolean,
default: true,
},
initPage: {
type: Number,
default: 1,
},
},
components: {},
created() {
this.page = this.initPage;
},
mounted() {},
destroyed() {},
methods: {
loadmore() {
this.$emit("loadmore", this.page);
},
},
};
</script>
<style lang="less" scoped>
.loadmore {
width: 100%;
text-align: center;
.text {
font-size: 22rpx;
font-weight: bold;
color: #a0a0a0;
}
}
</style>