nomore.vue 2.1 KB

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