index.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <div :class="[prefixCls, getLayoutContentMode]" v-loading="getOpenPageLoading && getPageLoading">
  3. <PageLayout />
  4. <!-- update-begin-author:zyf date:20211129 for:qiankun 挂载子应用盒子 -->
  5. <div id="content" class="app-view-box" v-if="openQianKun == 'true'"></div>
  6. <!-- update-end-author:zyf date:20211129 for: qiankun 挂载子应用盒子-->
  7. </div>
  8. </template>
  9. <script lang="ts">
  10. import { defineComponent, onMounted } from 'vue';
  11. import PageLayout from '/@/layouts/page/index.vue';
  12. import { useDesign } from '/@/hooks/web/useDesign';
  13. import { useRootSetting } from '/@/hooks/setting/useRootSetting';
  14. import { useTransitionSetting } from '/@/hooks/setting/useTransitionSetting';
  15. import { useContentViewHeight } from './useContentViewHeight';
  16. // import registerApps from '/@/qiankun';
  17. import { useGlobSetting } from '/@/hooks/setting';
  18. export default defineComponent({
  19. name: 'LayoutContent',
  20. components: { PageLayout },
  21. setup() {
  22. const { prefixCls } = useDesign('layout-content');
  23. const { getOpenPageLoading } = useTransitionSetting();
  24. const { getLayoutContentMode, getPageLoading } = useRootSetting();
  25. const globSetting = useGlobSetting();
  26. const openQianKun = globSetting.openQianKun;
  27. useContentViewHeight();
  28. onMounted(() => {
  29. // //注册openQianKun
  30. // if (openQianKun == 'true') {
  31. // if (!window.qiankunStarted) {
  32. // window.qiankunStarted = true;
  33. // registerApps();
  34. // }
  35. // }
  36. });
  37. return {
  38. prefixCls,
  39. openQianKun,
  40. getOpenPageLoading,
  41. getLayoutContentMode,
  42. getPageLoading,
  43. };
  44. },
  45. });
  46. </script>
  47. <style lang="less">
  48. @prefix-cls: ~'@{namespace}-layout-content';
  49. .@{prefix-cls} {
  50. position: relative;
  51. flex: 1 1 auto;
  52. min-height: 0;
  53. &.fixed {
  54. width: 1200px;
  55. margin: 0 auto;
  56. }
  57. &-loading {
  58. position: absolute;
  59. top: 200px;
  60. z-index: @page-loading-z-index;
  61. }
  62. }
  63. </style>