tui-nomore.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <view class="tui-nomore-class tui-loadmore-none" v-if="visible">
  3. <view :class="[isDot?'tui-nomore-dot':'tui-nomore']">
  4. <view :style="{backgroundColor:backgroundColor,color:color}" :class="[isDot?'tui-dot-text':'tui-nomore-text']">{{isDot?dotText:text}}</view>
  5. </view>
  6. </view>
  7. </template>
  8. <script>
  9. export default {
  10. name: 'tuiNomore',
  11. props: {
  12. //是否可见
  13. visible: {
  14. type: Boolean,
  15. default: false
  16. },
  17. //当前页面背景颜色
  18. backgroundColor: {
  19. type: String,
  20. default: '#fafafa'
  21. },
  22. //是否以圆点代替 "没有更多了"
  23. isDot: {
  24. type: Boolean,
  25. default: false
  26. },
  27. //是否以圆点代替 "没有更多了"
  28. color: {
  29. type: String,
  30. default: '#999999'
  31. },
  32. //isDot为false时生效
  33. text: {
  34. type: String,
  35. default: '没有更多了'
  36. }
  37. },
  38. data() {
  39. return {
  40. dotText: '●'
  41. }
  42. }
  43. }
  44. </script>
  45. <style scoped>
  46. .tui-loadmore-none {
  47. width: 50%;
  48. margin: 1.5em auto;
  49. line-height: 1.5em;
  50. font-size: 24rpx;
  51. display: flex;
  52. justify-content: center;
  53. }
  54. .tui-nomore {
  55. width: 100%;
  56. height: 100%;
  57. position: relative;
  58. display: flex;
  59. justify-content: center;
  60. margin-top: 10rpx;
  61. padding-bottom: 6rpx;
  62. }
  63. .tui-nomore::before {
  64. content: ' ';
  65. position: absolute;
  66. border-bottom: 1rpx solid #e5e5e5;
  67. -webkit-transform: scaleY(0.5);
  68. transform: scaleY(0.5);
  69. width: 100%;
  70. top: 18rpx;
  71. left: 0;
  72. }
  73. .tui-nomore-text {
  74. color: #999;
  75. font-size: 24rpx;
  76. text-align: center;
  77. padding: 0 18rpx;
  78. height: 36rpx;
  79. line-height: 36rpx;
  80. position: relative;
  81. z-index: 1;
  82. }
  83. .tui-nomore-dot {
  84. position: relative;
  85. text-align: center;
  86. -webkit-display: flex;
  87. display: flex;
  88. -webkit-justify-content: center;
  89. justify-content: center;
  90. margin-top: 10rpx;
  91. padding-bottom: 6rpx;
  92. }
  93. .tui-nomore-dot::before {
  94. content: '';
  95. position: absolute;
  96. border-bottom: 1rpx solid #e5e5e5;
  97. -webkit-transform: scaleY(0.5) translateX(-50%);
  98. transform: scaleY(0.5) translateX(-50%);
  99. width: 360rpx;
  100. top: 18rpx;
  101. left: 50%;
  102. }
  103. .tui-dot-text {
  104. position: relative;
  105. color: #e5e5e5;
  106. font-size: 10px;
  107. text-align: center;
  108. width: 50rpx;
  109. height: 36rpx;
  110. line-height: 36rpx;
  111. -webkit-transform: scale(0.8);
  112. transform: scale(0.8);
  113. -webkit-transform-origin: center center;
  114. transform-origin: center center;
  115. z-index: 1;
  116. }
  117. </style>