style: common component style

This commit is contained in:
jialin
2024-05-27 19:29:03 +08:00
parent 7ff9b44644
commit 3120f5ee3a
26 changed files with 736 additions and 166 deletions
+25 -8
View File
@@ -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
)}