ant-design/components/dropdown/demo/selectable.md
二货机器人 63fc5055f9
fix: Table customize filterDropdown with Menu should not block default selectable (#36098)
* fix: Table customize Menu should be selectable

* test: Add test case

* test: Update snapshow
2022-06-17 14:37:18 +08:00

864 B

order title
10
zh-CN en-US
菜单可选选择 Selectable Menu

zh-CN

为 Menu 添加 selectable 属性可以开启选择能力。

en-US

Config Menu selectable prop to enable selectable ability.

import { DownOutlined } from '@ant-design/icons';
import { Dropdown, Menu, Space, Typography } from 'antd';
import React from 'react';

const menu = (
  <Menu
    selectable
    defaultSelectedKeys={['3']}
    items={[
      {
        key: '1',
        label: 'Item 1',
      },
      {
        key: '2',
        label: 'Item 2',
      },
      {
        key: '3',
        label: 'Item 3',
      },
    ]}
  />
);

const App: React.FC = () => (
  <Dropdown overlay={menu}>
    <Typography.Link>
      <Space>
        Selectable
        <DownOutlined />
      </Space>
    </Typography.Link>
  </Dropdown>
);

export default App;