harrywan 6ab2c29984 refactor: 重构plugin-layout,统一配置
* docs: 更新文档

* break: plugin-layout优化api

* break: 去掉switch配置,改为使用navigation

* feat: 重构layout

* docs: 升级文档

* feat: 无logo和title时隐藏dom

* fix: 修复一些问题

* fix: 配置提示

* fix: build watch copy 路径识别问题

* docs: 文档

Co-authored-by: winixt <haizekuo@gmail.com>
2022-06-22 14:25:47 +08:00

57 lines
1.5 KiB
TypeScript

import {Component, VNode, Ref } from 'vue';
import { Router, NavigationGuard } from 'vue-router';
interface Menu {
name: string;
path: string;
match: string[];
title: string;
icon: string | Component;
children?: Menu[]
}
export interface LayoutBuildConfig {
layout: {
footer: string;
theme: 'dark' | 'light';
navigation: 'side' | 'top' | 'mixin' | 'left-right';
title: string;
isFixedHeader: boolean;
isFixedSidebar: boolean;
logo: string;
multiTabs: boolean;
sideWidth: number;
menus: Menu[];
menuProps: {
expandedKeys: string[];
defaultExpandAll: boolean;
accordion: boolean;
};
};
}
export interface LayoutRuntimeConfig {
layout: {
footer: string;
theme: 'dark' | 'light';
navigation: 'side' | 'top' | 'mixin' | 'left-right';
title: string;
isFixedHeader: boolean;
isFixedSidebar: boolean;
logo: string;
multiTabs: boolean;
sideWidth: number;
menus: Menu[] | (()=> (Ref<Menu[]> | Menu[]));
menuProps: {
expandedKeys: string[];
defaultExpandAll: boolean;
accordion: boolean;
};
renderCustom: ()=> VNode[],
noFoundHandler: (param: { router: Router } & NavigationGuard) => void;
unAccessHandler: (param: { router: Router } & NavigationGuard) => void;
};
}