2023-03-04 09:16:33 +08:00
|
|
|
<!-- 💥 这里是一次性加载 LayoutComponents -->
|
|
|
|
|
<template>
|
|
|
|
|
<component :is="LayoutComponents[themeConfig.layout]" />
|
|
|
|
|
<ThemeDrawer />
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts" name="layout">
|
|
|
|
|
import { computed, type Component } from "vue";
|
|
|
|
|
import { GlobalStore } from "@/stores";
|
|
|
|
|
import ThemeDrawer from "./components/ThemeDrawer/index.vue";
|
2023-04-25 10:48:27 +08:00
|
|
|
// import LayoutVertical from "./LayoutVertical/index.vue";
|
2023-03-04 09:16:33 +08:00
|
|
|
import LayoutClassic from "./LayoutClassic/index.vue";
|
2023-04-25 10:48:27 +08:00
|
|
|
// import LayoutTransverse from "./LayoutTransverse/index.vue";
|
|
|
|
|
// import LayoutColumns from "./LayoutColumns/index.vue";
|
2023-03-04 09:16:33 +08:00
|
|
|
|
|
|
|
|
const LayoutComponents: { [key: string]: Component } = {
|
2023-04-25 10:48:27 +08:00
|
|
|
// vertical: LayoutVertical,
|
|
|
|
|
classic: LayoutClassic
|
|
|
|
|
// transverse: LayoutTransverse,
|
|
|
|
|
// columns: LayoutColumns
|
2023-03-04 09:16:33 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const globalStore = GlobalStore();
|
|
|
|
|
const themeConfig = computed(() => globalStore.themeConfig);
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.layout {
|
|
|
|
|
min-width: 760px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|