@antdp/basic-layouts
入口公共界面
Installation
npm i @antdp/basic-layouts --save
Basic Usage
import BasicLayout from '@antdp/basic-layouts';
import logo from './logo.svg';
import { useIntl,SelectLang } from 'umi';
export default (props) => {
return (
<BasicLayout
{...props}
projectName="Ant Design Pro2"
logo={logo}
intlLanguage={useIntl()}
topRightLanguage={<SelectLang />}
/>
)
};
Component Interface
export interface RouterData {
path: string;
redirect?: string;
component?: string;
icon?: string;
routes?: RouterData[];
side?: boolean
index?: boolean;
}
interface BaseLayoutProps {
logo?: JSX.Element;
projectName?: string;
route: RouterData;
siderWidth?: number;
profile?: {
avatar?: string,
name?: string,
};
topRightMenu?: (MenuItemProps | { divider: boolean })[];
bodyPadding?: number;
location: Location;
history: History;
staticContext?: any;
match: {
isExact: boolean;
params: any;
path: string;
url: string;
};
intlLanguage:useIntl();
topRightLanguage:React.ReactNode;
logoJumpTo?:string;
}