uni-load-more.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <view class="uni-load-more">
  3. <view v-show="status === 'loading' && showIcon" class="uni-load-more__img">
  4. <view class="load1">
  5. <view :style="{background:color}" />
  6. <view :style="{background:color}" />
  7. <view :style="{background:color}" />
  8. <view :style="{background:color}" />
  9. </view>
  10. <view class="load2">
  11. <view :style="{background:color}" />
  12. <view :style="{background:color}" />
  13. <view :style="{background:color}" />
  14. <view :style="{background:color}" />
  15. </view>
  16. <view class="load3">
  17. <view :style="{background:color}" />
  18. <view :style="{background:color}" />
  19. <view :style="{background:color}" />
  20. <view :style="{background:color}" />
  21. </view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. name: 'UniLoadMore',
  28. props: {
  29. status: {
  30. // 上拉的状态:more-loading前;loading-loading中;noMore-没有更多了
  31. type: String,
  32. default: 'more'
  33. },
  34. showIcon: {
  35. type: Boolean,
  36. default: true
  37. },
  38. color: {
  39. type: String,
  40. default: '#777777'
  41. },
  42. contentText: {
  43. type: Object,
  44. default () {
  45. return {
  46. contentdown: '上拉显示更多',
  47. contentrefresh: '正在加载...',
  48. contentnomore: '没有更多数据了'
  49. }
  50. }
  51. }
  52. },
  53. data() {
  54. return {}
  55. }
  56. }
  57. </script>
  58. <!--<style>-->
  59. <!--@charset "UTF-8";-->
  60. <!--.uni-load-more {-->
  61. <!--display: flex;-->
  62. <!--flex-direction: row;-->
  63. <!--height: 25px;-->
  64. <!--align-items: center;-->
  65. <!--justify-content: center-->
  66. <!--}-->
  67. <!--.uni-load-more__text {-->
  68. <!--font-size: 28upx;-->
  69. <!--color: #999-->
  70. <!--}-->
  71. <!--.uni-load-more__img {-->
  72. <!--height: 24px;-->
  73. <!--width: 24px;-->
  74. <!--margin-right: 10px-->
  75. <!--}-->
  76. <!--.uni-load-more__img>view {-->
  77. <!--position: absolute-->
  78. <!--}-->
  79. <!--/*.uni-load-more__img>view view {*/-->
  80. <!--/*width: 6px;*/-->
  81. <!--/*height: 2px;*/-->
  82. <!--/*border-top-left-radius: 1px;*/-->
  83. <!--/*border-bottom-left-radius: 1px;*/-->
  84. <!--/*background: #999;*/-->
  85. <!--/*position: absolute;*/-->
  86. <!--/*opacity: .2;*/-->
  87. <!--/*transform-origin: 50%;*/-->
  88. <!--/*animation: load 1.56s ease infinite*/-->
  89. <!--/*}*/-->
  90. <!--.uni-load-more__img>view view:nth-child(1) {-->
  91. <!--transform: rotate(90deg);-->
  92. <!--top: 2px;-->
  93. <!--left: 9px-->
  94. <!--}-->
  95. <!--.uni-load-more__img>view view:nth-child(2) {-->
  96. <!--transform: rotate(180deg);-->
  97. <!--top: 2px;-->
  98. <!--right: 0-->
  99. <!--}-->
  100. <!--.uni-load-more__img>view view:nth-child(3) {-->
  101. <!--transform: rotate(270deg);-->
  102. <!--bottom: 2px;-->
  103. <!--left: 9px-->
  104. <!--}-->
  105. <!--.uni-load-more__img>view view:nth-child(4) {-->
  106. <!--top: 2px;-->
  107. <!--left: 0-->
  108. <!--}-->
  109. <!--.load1,-->
  110. <!--.load2,-->
  111. <!--.load3 {-->
  112. <!--height: 24px;-->
  113. <!--width: 24px-->
  114. <!--}-->
  115. <!--.load2 {-->
  116. <!--transform: rotate(30deg)-->
  117. <!--}-->
  118. <!--.load3 {-->
  119. <!--transform: rotate(60deg)-->
  120. <!--}-->
  121. <!--.load1 view:nth-child(1) {-->
  122. <!--animation-delay: 0s-->
  123. <!--}-->
  124. <!--.load2 view:nth-child(1) {-->
  125. <!--animation-delay: .13s-->
  126. <!--}-->
  127. <!--.load3 view:nth-child(1) {-->
  128. <!--animation-delay: .26s-->
  129. <!--}-->
  130. <!--.load1 view:nth-child(2) {-->
  131. <!--animation-delay: .39s-->
  132. <!--}-->
  133. <!--.load2 view:nth-child(2) {-->
  134. <!--animation-delay: .52s-->
  135. <!--}-->
  136. <!--.load3 view:nth-child(2) {-->
  137. <!--animation-delay: .65s-->
  138. <!--}-->
  139. <!--.load1 view:nth-child(3) {-->
  140. <!--animation-delay: .78s-->
  141. <!--}-->
  142. <!--.load2 view:nth-child(3) {-->
  143. <!--animation-delay: .91s-->
  144. <!--}-->
  145. <!--.load3 view:nth-child(3) {-->
  146. <!--animation-delay: 1.04s-->
  147. <!--}-->
  148. <!--.load1 view:nth-child(4) {-->
  149. <!--animation-delay: 1.17s-->
  150. <!--}-->
  151. <!--.load2 view:nth-child(4) {-->
  152. <!--animation-delay: 1.3s-->
  153. <!--}-->
  154. <!--.load3 view:nth-child(4) {-->
  155. <!--animation-delay: 1.43s-->
  156. <!--}-->
  157. <!--@-webkit-keyframes load {-->
  158. <!--0% {-->
  159. <!--opacity: 1-->
  160. <!--}-->
  161. <!--100% {-->
  162. <!--opacity: .2-->
  163. <!--}-->
  164. <!--}-->
  165. <!--</style>-->