feat(shell): add app shell and maintenance page driver
Introduce reusable shell components for layout, tabs, and global overlays. Add maintenance page model, wrapper component, and composable driver to standardize maintenance page state, search, and pagination handling.feat(shell): add app shell and maintenance page driver Introduce reusable shell components for layout, tabs, and global overlays. Add maintenance page model, wrapper component, and composable driver to standardize maintenance page state, search, and pagination handling.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import MainLayout from '@/components/layouts/MainLayout.vue'
|
||||
import PlainLayout from '@/components/layouts/PlainLayout.vue'
|
||||
import AppTabs from './AppTabs.vue'
|
||||
import GlobalOverlays from './GlobalOverlays.vue'
|
||||
import type { LayoutMenuItem } from '@/stores/menu'
|
||||
|
||||
defineProps<{
|
||||
menuItems?: LayoutMenuItem[]
|
||||
}>()
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
const layoutMap = {
|
||||
default: MainLayout,
|
||||
none: PlainLayout,
|
||||
}
|
||||
|
||||
const activeLayout = computed(
|
||||
() => layoutMap[route.meta.layout as 'default' | 'none'] || MainLayout
|
||||
)
|
||||
const showTabs = computed(() => route.meta.layout === 'default')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<component :is="activeLayout">
|
||||
<AppTabs :menu-items="menuItems" :show-tabs="showTabs">
|
||||
<slot />
|
||||
</AppTabs>
|
||||
</component>
|
||||
|
||||
<GlobalOverlays :menu-items="menuItems" @search-select="$emit('searchSelect', $event)" />
|
||||
</template>
|
||||
Reference in New Issue
Block a user