123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <div v-show="LoadingShow">
  3. <svg
  4. xmlns="http://www.w3.org/2000/svg"
  5. xmlns:xlink="http://www.w3.org/1999/xlink"
  6. :width="LoadingWidth"
  7. :height="LoadingHeight"
  8. viewBox="0 0 40 40"
  9. enable-background="new 0 0 40 40"
  10. xml:space="preserve"
  11. >
  12. <!-- loading背景灰色圆圈 -->
  13. <path
  14. opacity="0.2"
  15. fill="#fff"
  16. d="M20.201,5.169c-8.254,0-14.946,6.692-14.946,14.946c0,8.255,6.692,14.946,14.946,14.946
  17. s14.946-6.691,14.946-14.946C35.146,11.861,28.455,5.169,20.201,5.169z M20.201,31.749c-6.425,0-11.634-5.208-11.634-11.634
  18. c0-6.425,5.209-11.634,11.634-11.634c6.425,0,11.633,5.209,11.633,11.634C31.834,26.541,26.626,31.749,20.201,31.749z"
  19. />
  20. <!-- loading白色转动部分 -->
  21. <path
  22. fill="#fff"
  23. d="M26.013,10.047l1.654-2.866c-2.198-1.272-4.743-2.012-7.466-2.012h0v3.312h0
  24. C22.32,8.481,24.301,9.057,26.013,10.047z"
  25. transform="rotate(42.1171 20 20)"
  26. >
  27. <animateTransform
  28. attributeType="xml"
  29. attributeName="transform"
  30. type="rotate"
  31. from="0 20 20"
  32. to="360 20 20"
  33. dur="0.5s"
  34. repeatCount="indefinite"
  35. />
  36. </path>
  37. </svg>
  38. </div>
  39. </template>
  40. <script>
  41. export default {
  42. name: 'Loading',
  43. props: {
  44. LoadingWidth: {
  45. type: String,
  46. default: '30px'
  47. },
  48. LoadingHeight: {
  49. type: String,
  50. default: '30px'
  51. },
  52. LoadingShow: {
  53. type: Boolean,
  54. default: false,
  55. required: true
  56. }
  57. }
  58. }
  59. </script>
  60. <style>
  61. </style>