demo(space): replace 'overlay' in Dropdown (#48867)

* demo(space): replace 'overlay' in Dropdown

* test: update snap
This commit is contained in:
thinkasany 2024-05-10 19:19:35 +08:00 committed by GitHub
parent eb218e80c6
commit 7af1cc616b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 37 additions and 45 deletions

View File

@ -10005,11 +10005,7 @@ exports[`renders components/space/demo/compact-buttons.tsx extend context correc
</div>
`;
exports[`renders components/space/demo/compact-buttons.tsx extend context correctly 2`] = `
[
"Warning: [antd: Dropdown] \`overlay\` is deprecated. Please use \`menu\` instead.",
]
`;
exports[`renders components/space/demo/compact-buttons.tsx extend context correctly 2`] = `[]`;
exports[`renders components/space/demo/compact-debug.tsx extend context correctly 1`] = `
<div

View File

@ -11,7 +11,7 @@ import {
StarOutlined,
WarningOutlined,
} from '@ant-design/icons';
import { Button, Dropdown, Menu, Space, Tooltip } from 'antd';
import { Button, Dropdown, Space, Tooltip } from 'antd';
const App: React.FC = () => (
<div>
@ -36,27 +36,25 @@ const App: React.FC = () => (
</Tooltip>
<Dropdown
placement="bottomRight"
overlay={
<Menu
items={[
{
key: '1',
label: 'Report',
icon: <WarningOutlined />,
},
{
key: '2',
label: 'Mail',
icon: <MailOutlined />,
},
{
key: '3',
label: 'Mobile',
icon: <MobileOutlined />,
},
]}
/>
}
menu={{
items: [
{
key: '1',
label: 'Report',
icon: <WarningOutlined />,
},
{
key: '2',
label: 'Mail',
icon: <MailOutlined />,
},
{
key: '3',
label: 'Mobile',
icon: <MobileOutlined />,
},
],
}}
trigger={['click']}
>
<Button icon={<EllipsisOutlined />} />
@ -89,24 +87,22 @@ const App: React.FC = () => (
<Button type="primary">Button 4</Button>
<Dropdown
placement="bottomRight"
overlay={
<Menu
items={[
{
key: '1',
label: '1st item',
},
{
key: '2',
label: '2nd item',
},
{
key: '3',
label: '3rd item',
},
]}
/>
}
menu={{
items: [
{
key: '1',
label: '1st item',
},
{
key: '2',
label: '2nd item',
},
{
key: '3',
label: '3rd item',
},
],
}}
trigger={['click']}
>
<Button type="primary" icon={<EllipsisOutlined />} />