feat(layout): add configurable application layout

This commit is contained in:
Maofeng
2026-09-30 01:30:47 +08:00
parent 8b880a19e2
commit ffda0b9099
10 changed files with 665 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
export type HeaderStart = "rail" | "sidebar" | "content"
export type FooterStart = Exclude<HeaderStart, "rail">
export interface LayoutConfig {
asideEnabled: boolean
asideOpen: boolean
footerStart: FooterStart
headerStart: HeaderStart
sidebarCollapsible: boolean
sidebarOpen: boolean
}
export const defaultLayoutConfig = Object.freeze({
asideEnabled: true,
asideOpen: false,
footerStart: "content",
headerStart: "rail",
sidebarCollapsible: true,
sidebarOpen: true,
} satisfies LayoutConfig)
export function createLayoutConfig(
layout?: Partial<LayoutConfig>
): LayoutConfig {
return { ...defaultLayoutConfig, ...layout }
}