fs-loading.vue 1002 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <view class="fs-loading" :style="{backgroundColor: bgColor}">
  3. <view>
  4. <view class="loader"></view>
  5. <slot></slot>
  6. </view>
  7. </view>
  8. </template>
  9. <script setup>
  10. const props = defineProps({
  11. bgColor: {
  12. type: String,
  13. default: 'rgba(0,0,0,.5)'
  14. }
  15. })
  16. </script>
  17. <style lang="scss" scoped>
  18. .fs-loading{
  19. position: absolute;
  20. top: 0;
  21. left: 0;
  22. text-align: center;
  23. width: 100%;
  24. height: 100%;
  25. display: flex;
  26. align-items: center;
  27. justify-content: center;
  28. color: #fff;
  29. z-index: 20;
  30. }
  31. .loader {
  32. margin: 0 auto 20rpx;
  33. font-size: 12rpx;
  34. position: relative;
  35. border-top: 1em solid rgba(255, 255, 255, 0.2);
  36. border-right: 1em solid rgba(255, 255, 255, 0.2);
  37. border-bottom: 1em solid rgba(255, 255, 255, 0.2);
  38. border-left: 1em solid #fff;
  39. animation: load8 1s infinite linear;
  40. }
  41. .loader,
  42. .loader:after {
  43. border-radius: 50%;
  44. width: 10em;
  45. height: 10em;
  46. }
  47. @keyframes load8 {
  48. 0% {
  49. transform: rotate(0deg);
  50. }
  51. 100% {
  52. transform: rotate(360deg);
  53. }
  54. }
  55. </style>