LayoutContent.tsx 1.0 KB
Newer Older
V
vben 已提交
1
import { computed, defineComponent, unref } from 'vue';
V
vben 已提交
2
import { Layout } from 'ant-design-vue';
V
vben 已提交
3 4
import { FullLoading } from '/@/components/Loading/index';

V
vben 已提交
5 6
import { RouterView } from 'vue-router';

陈文彬 已提交
7 8 9 10 11
import { ContentEnum } from '/@/enums/appEnum';
import { appStore } from '/@/store/modules/app';
export default defineComponent({
  name: 'DefaultLayoutContent',
  setup() {
V
vben 已提交
12 13 14 15
    const getProjectConfigRef = computed(() => {
      return appStore.getProjectConfig;
    });

陈文彬 已提交
16
    return () => {
V
vben 已提交
17 18 19
      const { contentMode, openPageLoading } = unref(getProjectConfigRef);
      const { getPageLoading } = appStore;

陈文彬 已提交
20 21
      const wrapClass = contentMode === ContentEnum.FULL ? 'full' : 'fixed';
      return (
V
vben 已提交
22 23 24 25 26 27 28 29
        <div class={[`default-layout__main`]}>
          {openPageLoading && (
            <FullLoading class={[`default-layout__loading`, !getPageLoading && 'hidden']} />
          )}
          <Layout.Content class={`layout-content ${wrapClass} `}>
            {() => <RouterView />}
          </Layout.Content>
        </div>
陈文彬 已提交
30 31 32 33
      );
    };
  },
});