<template>
    <view class="load-more" v-if="visiable">
        <tui-loadmore text="加载中..." v-if="isLoading"></tui-loadmore>
        <tui-nomore :text="message" v-else :backgroundColor="backgroundColor"></tui-nomore>
    </view>
</template>

<script>
export default {
    name: 'cm-loadmore',
    props: {
        hasNextPage: {
            type: Boolean,
            default: false
        },
        isLoading: {
            type: Boolean,
            default: false
        },
        visiable: {
            type: Boolean,
            default: false
        },
        backgroundColor:{
            type: String,
            default: '#f7f7f7'
        }
    },
    computed: {
        message() {
            return this.hasNextPage ? '上拉加载更多' : '没有更多了'
        }
    }
}
</script>

<style lang="scss" scoped></style>
