loading.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. //loading组件
  2. <template>
  3. <view v-if="loading" class="loading_container">
  4. <view class="loading">
  5. <view class="loading_a"></view>
  6. <view class="loading_b"></view>
  7. <view class="loading_c"></view>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. props:{
  14. loading:{
  15. type:Boolean
  16. }
  17. }
  18. };
  19. </script>
  20. <style scoped>
  21. .loading_container {
  22. position: fixed;
  23. left: 0;
  24. right: 0;
  25. top: 0;
  26. bottom: 0;
  27. background:#fff;
  28. z-index: 10000;
  29. display: flex;
  30. justify-content: center;
  31. align-items: center;
  32. }
  33. @keyframes ball-beat {
  34. 50% {
  35. opacity: 0.2;
  36. -webkit-transform: scale(0.75);
  37. transform: scale(0.75);
  38. }
  39. 100% {
  40. opacity: 1;
  41. -webkit-transform: scale(1);
  42. transform: scale(1);
  43. }
  44. }
  45. .loading {
  46. width: 200rpx;
  47. margin-top: -36rpx;
  48. display: flex;
  49. flex-direction: row;
  50. justify-content: space-between;
  51. }
  52. .loading_a,
  53. .loading_b,
  54. .loading_c {
  55. width: 40rpx;
  56. height: 40rpx;
  57. margin: 10rpx;
  58. display: inline-block;
  59. -webkit-animation: ball-beat 0.7s 0s infinite linear;
  60. animation: ball-beat 0.7s 0s infinite linear;
  61. background-color: #5096fa;
  62. border-radius: 100%;
  63. }
  64. .loading_b {
  65. -webkit-animation-delay: -0.35s !important;
  66. animation-delay: -0.35s !important;
  67. }
  68. </style>