cm-loadmore.vue 850 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <template>
  2. <view class="load-more" v-if="visiable">
  3. <tui-loadmore text="加载中..." v-if="isLoading"></tui-loadmore>
  4. <tui-nomore :text="message" v-else :backgroundColor="backgroundColor"></tui-nomore>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. name: 'cm-loadmore',
  10. props: {
  11. hasNextPage: {
  12. type: Boolean,
  13. default: false
  14. },
  15. isLoading: {
  16. type: Boolean,
  17. default: false
  18. },
  19. visiable: {
  20. type: Boolean,
  21. default: false
  22. },
  23. backgroundColor:{
  24. type: String,
  25. default: '#f7f7f7'
  26. }
  27. },
  28. computed: {
  29. message() {
  30. return this.hasNextPage ? '上拉加载更多' : '没有更多了'
  31. }
  32. }
  33. }
  34. </script>
  35. <style lang="scss" scoped></style>