fix: 配置提示

This commit is contained in:
wanchun 2022-06-21 16:07:20 +08:00
parent 194eb03526
commit 6fe571cb13
3 changed files with 33 additions and 13 deletions

View File

@ -254,7 +254,7 @@ export const layout = (layoutConfig, { initialState }) => ({
### menusProps
### menuProps
- **类型**`Object`
- **默认值**`{}`
@ -346,6 +346,6 @@ export const access = {
1. 个性化 layout 配置改为使用传入 navigation
2. renderHeader 改为 renderCustom
3. fixedHeader 改为 isFixedHeader
4. menusConfig 改为 menusProps
4. menusConfig 改为 menuProps
5. fixedSideBar 改为 isFixedSidebar
6. 去掉运行时 logo、header、sidebar 三个区域显示配置,请改为使用 navigation: left-right

View File

@ -1 +1,3 @@
export Page from './views/page.vue';
import page from './views/page.vue';
export const Page = page;

View File

@ -1,4 +1,4 @@
import { Component } from 'vue';
import {Component, VNode, Ref } from 'vue';
import { Router, NavigationGuard } from 'vue-router';
interface Menu {
@ -6,21 +6,27 @@ interface Menu {
path: string;
match: string[];
title: string;
icon: string;
icon: string | Component;
children?: Menu[]
}
export interface LayoutBuildConfig {
layout: {
title: string;
footer: string;
theme: 'dark' | 'light';
navigation: 'side' | 'top' | 'mixin' | 'left-right';
title: string;
isFixedHeader: boolean;
isFixedSidebar: boolean;
logo: string;
multiTabs: boolean;
navigation: 'side' | 'top' | 'mixin';
fixedHeader: boolean;
fixedSideBar: boolean;
sideWidth: number;
menus: Menu[];
menuProps: {
expandedKeys: string[];
defaultExpandAll: boolean;
accordion: boolean;
};
};
}
@ -28,10 +34,22 @@ export interface LayoutBuildConfig {
export interface LayoutRuntimeConfig {
layout: {
header: boolean;
sidebar: boolean;
logo: boolean;
customHeader: Component,
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;
};