tui-nomore.vue 2.1 KB

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