refresh-box.uvue 828 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template>
  2. <view slot="refresher" class="refresh-box">
  3. <image v-if="state == 2" class="refresh-icon" src="https://web-ext-storage.dcloud.net.cn/hello-uni-app-x/refresh-box-run.gif" mode="widthFix"></image>
  4. <text class="tip-text">{{text[state]}}</text>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. data() {
  10. return {
  11. text: ['继续下拉执行刷新', '释放立即刷新', '刷新中', ""]
  12. }
  13. },
  14. props: {
  15. state: {
  16. type: Number,
  17. default: 0
  18. }
  19. }
  20. }
  21. </script>
  22. <style>
  23. .refresh-box {
  24. justify-content: center;
  25. align-items: center;
  26. flex-direction: row;
  27. width: 100%;
  28. height: 30px;
  29. }
  30. .refresh-icon {
  31. width: 20px;
  32. height: 20px;
  33. margin: 5px;
  34. }
  35. .tip-text {
  36. color: #888;
  37. font-size: 12px;
  38. }
  39. </style>