Blame view

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