LayoutContent.tsx 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. import { computed, defineComponent, unref } from 'vue';
  2. import { Layout } from 'ant-design-vue';
  3. import { FullLoading } from '/@/components/Loading/index';
  4. import { RouterView } from 'vue-router';
  5. import { ContentEnum } from '/@/enums/appEnum';
  6. import { appStore } from '/@/store/modules/app';
  7. export default defineComponent({
  8. name: 'DefaultLayoutContent',
  9. setup() {
  10. const getProjectConfigRef = computed(() => {
  11. return appStore.getProjectConfig;
  12. });
  13. return () => {
  14. const { contentMode, openPageLoading } = unref(getProjectConfigRef);
  15. const { getPageLoading } = appStore;
  16. const wrapClass = contentMode === ContentEnum.FULL ? 'full' : 'fixed';
  17. return (
  18. <div class={[`default-layout__main`]}>
  19. {openPageLoading && (
  20. <FullLoading class={[`default-layout__loading`, !getPageLoading && 'hidden']} />
  21. )}
  22. <Layout.Content class={`layout-content ${wrapClass} `}>
  23. {() => <RouterView />}
  24. </Layout.Content>
  25. </div>
  26. );
  27. };
  28. },
  29. });