Browse Source
Update to antd 4.20.0 for `Menu support items` (#9786)
* Update package.json
* Update AvatarDropdown.tsx
* Update AvatarDropdown.tsx
* Update AvatarDropdown.tsx
pull/9829/head
puxiao
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
28 additions and
21 deletions
-
package.json
-
src/components/RightContent/AvatarDropdown.tsx
|
|
|
@ -61,7 +61,7 @@ |
|
|
|
"@ant-design/pro-layout": "^6.35.0", |
|
|
|
"@ant-design/pro-table": "^2.71.0", |
|
|
|
"@umijs/route-utils": "^2.0.0", |
|
|
|
"antd": "^4.19.0", |
|
|
|
"antd": "^4.20.0", |
|
|
|
"classnames": "^2.3.0", |
|
|
|
"lodash": "^4.17.0", |
|
|
|
"moment": "^2.29.0", |
|
|
|
|
|
|
|
@ -68,28 +68,35 @@ const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ menu }) => { |
|
|
|
return loading; |
|
|
|
} |
|
|
|
|
|
|
|
const menuHeaderDropdown = ( |
|
|
|
<Menu className={styles.menu} selectedKeys={[]} onClick={onMenuClick}> |
|
|
|
{menu && ( |
|
|
|
<Menu.Item key="center"> |
|
|
|
<UserOutlined /> |
|
|
|
个人中心 |
|
|
|
</Menu.Item> |
|
|
|
)} |
|
|
|
{menu && ( |
|
|
|
<Menu.Item key="settings"> |
|
|
|
<SettingOutlined /> |
|
|
|
个人设置 |
|
|
|
</Menu.Item> |
|
|
|
)} |
|
|
|
{menu && <Menu.Divider />} |
|
|
|
const menuItems = [ |
|
|
|
...(menu |
|
|
|
? [ |
|
|
|
{ |
|
|
|
key: 'center', |
|
|
|
icon: <UserOutlined />, |
|
|
|
label: '个人中心', |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: 'settings', |
|
|
|
icon: <SettingOutlined />, |
|
|
|
label: '个人设置', |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'divider', |
|
|
|
}, |
|
|
|
] |
|
|
|
: []), |
|
|
|
{ |
|
|
|
key: 'logout', |
|
|
|
icon: <LogoutOutlined />, |
|
|
|
label: '退出登录', |
|
|
|
}, |
|
|
|
]; |
|
|
|
|
|
|
|
<Menu.Item key="logout"> |
|
|
|
<LogoutOutlined /> |
|
|
|
退出登录 |
|
|
|
</Menu.Item> |
|
|
|
</Menu> |
|
|
|
const menuHeaderDropdown = ( |
|
|
|
<Menu className={styles.menu} selectedKeys={[]} onClick={onMenuClick} items={menuItems} /> |
|
|
|
); |
|
|
|
|
|
|
|
return ( |
|
|
|
<HeaderDropdown overlay={menuHeaderDropdown}> |
|
|
|
<span className={`${styles.action} ${styles.account}`}> |
|
|
|
|