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> </div>
`; `;
exports[`renders components/space/demo/compact-buttons.tsx extend context correctly 2`] = ` 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-debug.tsx extend context correctly 1`] = ` exports[`renders components/space/demo/compact-debug.tsx extend context correctly 1`] = `
<div <div

View File

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