loading.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <view class="tui-loading-init" v-if="visible">
  3. <view class="tui-loading-center"></view>
  4. <view class="tui-loadmore-tips">{{text}}</view>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. name: "tuiLoading",
  10. props: {
  11. text: {
  12. type: String,
  13. default: "正在加载..."
  14. },
  15. visible: {
  16. type: Boolean,
  17. default: false
  18. }
  19. }
  20. }
  21. </script>
  22. <style>
  23. .tui-loading-init {
  24. min-width: 200upx;
  25. min-height: 200upx;
  26. max-width: 500upx;
  27. display: flex;
  28. align-items: center;
  29. justify-content: center;
  30. flex-direction: column;
  31. position: fixed;
  32. top: 50%;
  33. left: 50%;
  34. transform: translate(-50%, -50%);
  35. z-index: 9999;
  36. font-size: 26upx;
  37. color: #fff;
  38. background: rgba(0, 0, 0, 0.7);
  39. border-radius: 10upx;
  40. }
  41. .tui-loading-center {
  42. width: 50upx;
  43. height: 50upx;
  44. border: 3px solid #fff;
  45. border-radius: 50%;
  46. margin: 0 6px;
  47. display: inline-block;
  48. vertical-align: middle;
  49. clip-path: polygon(0% 0%, 100% 0%, 100% 40%, 0% 40%);
  50. animation: rotate 1s linear infinite;
  51. margin-bottom: 36upx;
  52. }
  53. .tui-loadmore-tips {
  54. text-align: center;
  55. padding: 0 20upx;
  56. box-sizing: border-box;
  57. }
  58. @-webkit-keyframes rotate {
  59. from {
  60. transform: rotatez(0deg);
  61. }
  62. to {
  63. transform: rotatez(360deg);
  64. }
  65. }
  66. @keyframes rotate {
  67. from {
  68. transform: rotatez(0deg);
  69. }
  70. to {
  71. transform: rotatez(360deg);
  72. }
  73. }
  74. </style>