index.vue 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <!-- 上拉加载 -->
  3. <view>
  4. <view class="Loads acea-row row-center-wrapper" v-if="loading && !loaded" style="margin-top: .2rem;">
  5. <view v-if="loading">
  6. <view class="iconfont icon-jiazai loading acea-row row-center-wrapper"></view>
  7. <slot name="loading"></slot>
  8. 正在加载中
  9. </view>
  10. <view v-else>
  11. <slot name="load"></slot>
  12. 上拉加载更多
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. name: "Loading",
  20. props: {
  21. loaded: {
  22. type: Boolean,
  23. default: false
  24. },
  25. loading: {
  26. type: Boolean,
  27. default: false
  28. }
  29. }
  30. };
  31. </script>
  32. <style>
  33. .Loads {
  34. height: 80upx;
  35. font-size: 25upx;
  36. color: #999;
  37. }
  38. .Loads .iconfont {
  39. font-size: 30upx;
  40. margin-right: 10upx;
  41. height: 32upx;
  42. line-height: 32upx;
  43. }
  44. /*加载动画*/
  45. @keyframes load {
  46. from {
  47. transform: rotate(0deg);
  48. }
  49. to {
  50. transform: rotate(360deg);
  51. }
  52. }
  53. .loadingpic {
  54. animation: load 3s linear 1s infinite;
  55. }
  56. .loading {
  57. animation: load linear 1s infinite;
  58. }
  59. </style>