header-sider-layout
Version:
ant-design-pro layout, based on pro-layout, with header and sider layout.
53 lines (52 loc) • 2.09 kB
TypeScript
import './index.less';
import React, { Component } from 'react';
import { MenuMode, MenuProps } from 'antd/es/menu';
import { MenuTheme } from 'antd/es/menu/MenuContext';
import { Settings } from '../defaultSettings';
import { MenuDataItem, MessageDescriptor, Route, RouterTypes, WithFalse } from '../typings';
export interface BaseMenuProps extends Partial<RouterTypes<Route>>, Omit<MenuProps, 'openKeys'>, Partial<Settings> {
className?: string;
collapsed?: boolean;
flatMenuKeys?: string[];
handleOpenChange?: (openKeys: string[]) => void;
isMobile?: boolean;
menuData?: MenuDataItem[];
mode?: MenuMode;
type?: 'sider' | 'top';
onCollapse?: (collapsed: boolean) => void;
onOpenChange?: (openKeys: string[]) => void;
openKeys?: WithFalse<string[]>;
style?: React.CSSProperties;
theme?: MenuTheme;
formatMessage?: (message: MessageDescriptor) => string;
menuItemRender?: WithFalse<(item: MenuDataItem & {
isUrl: boolean;
}, defaultDom: React.ReactNode) => React.ReactNode>;
}
export default class BaseMenu extends Component<BaseMenuProps> {
static defaultProps: Partial<BaseMenuProps>;
warp: HTMLDivElement | undefined;
constructor(props: BaseMenuProps);
state: {};
static getDerivedStateFromProps(props: BaseMenuProps): null;
/**
* 获得菜单子节点
*/
getNavMenuItems: (menusData?: MenuDataItem[]) => React.ReactNode[];
getSelectedMenuKeys: (pathname?: string | undefined) => string[];
/**
* get SubMenu or Item
*/
getSubMenuOrItem: (item: MenuDataItem) => React.ReactNode;
getIntlName: (item: MenuDataItem) => string | undefined;
/**
* 判断是否是http链接.返回 Link 或 a
* Judge whether it is http link.return a or Link
* @memberof SiderMenu
*/
getMenuItemPath: (item: MenuDataItem) => {} | null | undefined;
conversionPath: (path: string) => string;
getPopupContainer: (fixedHeader: boolean, layout: string) => HTMLElement;
getRef: (ref: HTMLDivElement) => void;
render(): React.ReactNode;
}