FullLoading.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <section class="full-loading" :style="getStyle">
  3. <BasicLoading :tip="tip" :size="SizeEnum.DEFAULT" />
  4. </section>
  5. </template>
  6. <script lang="ts">
  7. import type { PropType } from 'vue';
  8. import { defineComponent, computed } from 'vue';
  9. import BasicLoading from './BasicLoading.vue';
  10. import { SizeEnum } from '/@/enums/sizeEnum';
  11. export default defineComponent({
  12. name: 'FullLoading',
  13. components: { BasicLoading },
  14. props: {
  15. tip: {
  16. type: String as PropType<string>,
  17. default: '',
  18. },
  19. absolute: Boolean as PropType<boolean>,
  20. },
  21. setup(props) {
  22. const getStyle = computed((): any => {
  23. return props.absolute
  24. ? {
  25. position: 'absolute',
  26. left: 0,
  27. top: 0,
  28. 'z-index': 1,
  29. }
  30. : {};
  31. });
  32. return { getStyle, SizeEnum };
  33. },
  34. });
  35. </script>
  36. <style lang="less" scoped>
  37. .full-loading {
  38. display: flex;
  39. width: 100%;
  40. height: 100%;
  41. // background: rgba(255, 255, 255, 0.3);
  42. background: rgba(241, 241, 246, 0.7);
  43. justify-content: center;
  44. align-items: center;
  45. }
  46. </style>