FullLoading.vue
1008 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<template>
<section
class="full-loading flex justify-center bg-mask-light items-center h-full w-full"
:style="getStyle"
>
<BasicLoading :tip="tip" :size="SizeEnum.DEFAULT" />
</section>
</template>
<script lang="ts">
import type { PropType } from 'vue';
import { defineComponent, computed } from 'vue';
import BasicLoading from './BasicLoading.vue';
import { SizeEnum } from '/@/enums/sizeEnum';
export default defineComponent({
name: 'FullLoading',
components: { BasicLoading },
props: {
tip: {
type: String as PropType<string>,
default: '',
},
absolute: Boolean as PropType<boolean>,
},
setup(props) {
// 样式前缀
const getStyle = computed((): any => {
return props.absolute
? {
position: 'absolute',
left: 0,
top: 0,
'z-index': 1,
}
: {};
});
return { getStyle, SizeEnum };
},
});
</script>