QtLoading.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <transition name="fade">
  3. <div
  4. v-if="loading.visible"
  5. class="QtLoading vci-flex-rcm"
  6. >
  7. <vci-lottie-loading speed="2">
  8. <span
  9. class="vci-pst-cm vci-fs-24"
  10. style="z-index: 2;letter-spacing: .1em"
  11. >
  12. {{ loading.process }}%
  13. </span>
  14. </vci-lottie-loading>
  15. </div>
  16. </transition>
  17. </template>
  18. <script>
  19. // power by visual-ceiling, at 2023/8/17 9:57
  20. import VciLottieLoading from "@vci/vci/vue/v2/components/other/VciLottieLoading.vue";
  21. export default {
  22. name: "QtLoading",
  23. components: { VciLottieLoading },
  24. data() {
  25. return {
  26. loading: {
  27. visible: false,
  28. process: 0
  29. }
  30. };
  31. },
  32. methods: {
  33. show() {
  34. this.loading.process = 0;
  35. this.loading.visible = true;
  36. },
  37. hide() { this.loading.visible = false; },
  38. process(percent) {this.loading.process = percent.toFixed(1); }
  39. }
  40. };
  41. </script>
  42. <style lang="scss" scoped>
  43. .QtLoading {
  44. position: absolute;
  45. left: 0;
  46. top: 0;
  47. z-index: 8;
  48. width: 100%;
  49. height: 100%;
  50. background-color: rgba(#000, 0.5);
  51. backdrop-filter: blur(8px);
  52. }
  53. </style>