nebv
2020-10-11 03b6025d07e4df99474f80d3fa57e8b5238ba40c
提交 | 用户 | age
2f6253 1 <template>
03b602 2   <section class="full-loading" :style="getStyle">
2f6253 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
11   import { SizeEnum } from '/@/enums/sizeEnum';
12
13   export default defineComponent({
14     name: 'FullLoading',
15     components: { BasicLoading },
16     props: {
17       tip: {
18         type: String as PropType<string>,
19         default: '',
20       },
21       absolute: Boolean as PropType<boolean>,
22     },
23     setup(props) {
24       // 样式前缀
25       const getStyle = computed((): any => {
26         return props.absolute
27           ? {
28               position: 'absolute',
29               left: 0,
30               top: 0,
31               'z-index': 1,
32             }
33           : {};
34       });
35       return { getStyle, SizeEnum };
36     },
37   });
38 </script>
03b602 39 <style lang="less" scoped>
N 40   .full-loading {
41     display: flex;
42     width: 100%;
43     height: 100%;
44     background: rgba(255, 255, 255, 0.3);
45     justify-content: center;
46     align-items: center;
47   }
48 </style>