From ec5a5c49be8335f82fda90c44b4ecad7de63c8ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Sun, 28 Apr 2019 10:59:08 +0800 Subject: [PATCH] beter code --- src/layouts/BasicLayout.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/layouts/BasicLayout.tsx b/src/layouts/BasicLayout.tsx index 5cde19e2..a28d8348 100644 --- a/src/layouts/BasicLayout.tsx +++ b/src/layouts/BasicLayout.tsx @@ -23,7 +23,7 @@ export type BasicLayoutContext = { [K in 'location']: BasicLayoutProps[K] } & { }; const BasicLayout: React.FC = props => { - const { dispatch, children, route } = props; + const { dispatch, children, route, settings } = props; const { routes, authority } = route!; /** * constructor @@ -38,7 +38,6 @@ const BasicLayout: React.FC = props => { */ const handleMenuCollapse = (payload: boolean) => dispatch!({ type: 'global/changeLayoutCollapsed', payload }); - return ( <> = props => { onCollapse={handleMenuCollapse} rightContentRender={RightProps => } {...props} + {...settings} > {children} + settings={settings} + onSettingChange={config => dispatch!({ type: 'settings/changeSetting', - payload: settings, + payload: config, }) } /> -- GitLab