Files
pqs-9100_client/frontend/src/layouts/index.vue

35 lines
973 B
Vue
Raw Normal View History

2024-08-22 11:27:06 +08:00
<!-- 💥 这里是一次性加载 LayoutComponents -->
2024-08-21 14:52:36 +08:00
<template>
2024-08-22 11:27:06 +08:00
<component :is="LayoutComponents[layout]" />
<ThemeDrawer />
2024-08-27 15:40:58 +08:00
2024-08-21 14:52:36 +08:00
</template>
2024-08-22 11:27:06 +08:00
<script setup lang="ts" name="layout">
import { computed, type Component } from "vue";
import { LayoutType } from "@/stores/interface";
import { useGlobalStore } from "@/stores/modules/global";
import ThemeDrawer from "./components/ThemeDrawer/index.vue";
import LayoutVertical from "./LayoutVertical/index.vue";
import LayoutClassic from "./LayoutClassic/index.vue";
import LayoutTransverse from "./LayoutTransverse/index.vue";
import LayoutColumns from "./LayoutColumns/index.vue";
2024-08-21 14:52:36 +08:00
2024-08-22 11:27:06 +08:00
const LayoutComponents: Record<LayoutType, Component> = {
vertical: LayoutVertical,
classic: LayoutClassic,
transverse: LayoutTransverse,
columns: LayoutColumns
};
2024-08-21 14:52:36 +08:00
2024-08-22 11:27:06 +08:00
const globalStore = useGlobalStore();
const layout = computed(() => globalStore.layout);
2024-08-21 14:52:36 +08:00
</script>
2024-08-22 11:27:06 +08:00
<style scoped lang="scss">
.layout {
min-width: 600px;
}
2024-08-21 14:52:36 +08:00
</style>