load-more.ts 936 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. Component({
  2. externalClasses: ['wr-class', 'wr-class--no-more'],
  3. options: { multipleSlots: true },
  4. properties: {
  5. status: {
  6. type: Number,
  7. value: 0,
  8. },
  9. loadingText: {
  10. type: String,
  11. value: '加载中...',
  12. },
  13. noMoreText: {
  14. type: String,
  15. value: '没有更多了',
  16. },
  17. failedText: {
  18. type: String,
  19. value: '加载失败,点击重试',
  20. },
  21. color: {
  22. type: String,
  23. value: '#BBBBBB',
  24. },
  25. failedColor: {
  26. type: String,
  27. value: '#FA550F',
  28. },
  29. size: {
  30. type: null,
  31. value: '40rpx',
  32. },
  33. loadingBackgroundColor: {
  34. type: String,
  35. value: '#F5F5F5',
  36. },
  37. listIsEmpty: {
  38. type: Boolean,
  39. value: false,
  40. },
  41. },
  42. methods: {
  43. /** 点击处理 */
  44. tapHandle() {
  45. // 失败重试
  46. if (this.data.status === 3) {
  47. this.triggerEvent('retry')
  48. }
  49. },
  50. },
  51. })