123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <template>
- <div style="position: absolute; width: 100%; height: 100%">
- <a-spin class="loading-box" size="large" :spinning="loading" tip="正在加载,请稍等。。。" />
- </div>
- <div id="micro-need-air"></div>
- </template>
- <script lang="ts">
- import { onMounted, onBeforeUnmount, defineComponent, ref, unref } from 'vue';
- import { unmountMicroApps, mountMicroApp } from '/@/qiankun';
- import { resetMicroContentWH } from '/@/utils/domUtils';
- import { useRouter } from 'vue-router';
- export default defineComponent({
- name: 'NeedAir',
- setup() {
- const loading = ref(true);
- const { currentRoute } = useRouter();
- onMounted(() => {
- mountMicroApp(unref(currentRoute).fullPath);
- resetMicroContentWH('micro-need-air', () => {
- loading.value = false;
- });
- });
- onBeforeUnmount(() => {
- unmountMicroApps(currentRoute);
- });
- return { loading };
- },
- });
- </script>
- <style lang="less" scoped>
- .loading-box {
- position: fixed;
- display: flex;
- align-items: center;
- justify-content: center;
- width: 100%;
- height: 100%;
- }
- #micro-need-air {
- width: 100%;
- height: 100%;
- }
- </style>
|