index.vue 766 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <template>
  2. <div
  3. class="tui-loading"
  4. :style="{
  5. width: props.width,
  6. height: props.height,
  7. border: `2px solid ${props.color}`,
  8. borderTopColor: 'transparent',
  9. }"
  10. />
  11. </template>
  12. <script setup lang="ts">
  13. const props = defineProps({
  14. width: {
  15. type: String,
  16. default: '30px',
  17. },
  18. height: {
  19. type: String,
  20. default: '30px',
  21. },
  22. color: {
  23. type: String,
  24. default: '#D9D9D9',
  25. },
  26. });
  27. </script>
  28. <style scoped lang="scss">
  29. .tui-loading {
  30. width: 30px;
  31. height: 30px;
  32. border: 2px solid #d9d9d9;
  33. border-top-color: transparent;
  34. border-radius: 100%;
  35. animation: circle infinite 0.75s linear;
  36. }
  37. @keyframes circle {
  38. 0% {
  39. transform: rotate(0);
  40. }
  41. 100% {
  42. transform: rotate(360deg);
  43. }
  44. }
  45. </style>