style: common component style
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
import { PageContainer } from '@ant-design/pro-components';
|
||||
import { Access, useAccess } from '@umijs/max';
|
||||
import { Button } from 'antd';
|
||||
|
||||
const Dashboard: React.FC = () => {
|
||||
const access = useAccess();
|
||||
return (
|
||||
<PageContainer
|
||||
ghost
|
||||
header={{
|
||||
title: 'Dashboard',
|
||||
}}
|
||||
>
|
||||
<Access accessible={access.canSeeAdmin}>
|
||||
<Button type="primary">==================</Button>
|
||||
</Access>
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
|
||||
export default Dashboard;
|
||||
+17
-9
@@ -93,17 +93,25 @@ export default (props: any) => {
|
||||
|
||||
const formatMessage = undefined;
|
||||
|
||||
const runtimeConfig = pluginManager.applyPlugins({
|
||||
key: 'layout',
|
||||
type: 'modify',
|
||||
logout: true,
|
||||
initialValue: {
|
||||
...initialInfo,
|
||||
notFound: <div>not found</div>
|
||||
}
|
||||
});
|
||||
// const runtimeConfig = pluginManager.applyPlugins({
|
||||
// key: 'layout',
|
||||
// type: 'modify',
|
||||
// logout: true,
|
||||
// initialValue: {
|
||||
// ...initialInfo,
|
||||
// notFound: <div>not found</div>
|
||||
// }
|
||||
// });
|
||||
const runtimeConfig = {
|
||||
...initialInfo,
|
||||
logout: () => {
|
||||
console.log('logout');
|
||||
},
|
||||
notFound: <div>not found</div>
|
||||
};
|
||||
console.log(
|
||||
'clientRoute==========2=',
|
||||
props,
|
||||
clientRoutes,
|
||||
runtimeConfig,
|
||||
initialInfo
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// @ts-nocheck
|
||||
// This file is generated by Umi automatically
|
||||
// DO NOT CHANGE IT MANUALLY!
|
||||
|
||||
import avatarImg from '@/assets/images/avatar.png';
|
||||
import { LogoutOutlined } from '@ant-design/icons';
|
||||
import { Avatar, Dropdown, Menu, Spin, version } from 'antd';
|
||||
@@ -11,6 +10,7 @@ export function getRightRenderContent(opts: {
|
||||
initialState: any;
|
||||
setInitialState: any;
|
||||
}) {
|
||||
console.log('runtimeConfig==', opts.runtimeConfig, opts);
|
||||
if (opts.runtimeConfig.rightRender) {
|
||||
return opts.runtimeConfig.rightRender(
|
||||
opts.initialState,
|
||||
@@ -67,6 +67,20 @@ export function getRightRenderContent(opts: {
|
||||
onClick: () => {
|
||||
opts?.runtimeConfig?.logout?.(opts.initialState);
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'theme',
|
||||
label: <>外观</>,
|
||||
onClick: () => {
|
||||
console.log('theme');
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'lang',
|
||||
label: '语言',
|
||||
onClick: () => {
|
||||
console.log('lang');
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -96,12 +110,15 @@ export function getRightRenderContent(opts: {
|
||||
return (
|
||||
<div className="umi-plugin-layout-right anticon">
|
||||
{opts.runtimeConfig.logout ? (
|
||||
<Dropdown
|
||||
{...dropdownProps}
|
||||
overlayClassName="umi-plugin-layout-container"
|
||||
>
|
||||
{avatar}
|
||||
</Dropdown>
|
||||
<>
|
||||
<Dropdown
|
||||
{...dropdownProps}
|
||||
overlayClassName="umi-plugin-layout-container"
|
||||
>
|
||||
{avatar}
|
||||
</Dropdown>
|
||||
<span></span>
|
||||
</>
|
||||
) : (
|
||||
avatar
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user