Replies: 3 comments 9 replies
This comment was marked as off-topic.
This comment was marked as off-topic.
-
|
本来 menu 已经把所有扩展菜单都已经收掉了,置顶功能按目前的设计规范也可以放到 menu 里: 如果不考虑新增除了 那是否用 menu 属性自定义 trigger 就够了。
const menuConfig: ConversationsProps['menu'] = (conversation) => ({
+ trigger: <PlusSquareOutlined />,
items: [
{
label: 'Operation 1',
key: 'operation1',
icon: <EditOutlined />,
},
{
label: 'Operation 2',
key: 'operation2',
icon: <StopOutlined />,
disabled: true,
},
{
label: 'Operation 3',
key: 'operation3',
icon: <DeleteOutlined />,
danger: true,
},
],
onClick: (menuInfo) => {
message.info(`Click ${conversation.key} - ${menuInfo.key}`);
},
}); |
Beta Was this translation helpful? Give feedback.
7 replies
-
|
结论: const menuConfig: ConversationsProps['menu'] = (conversation) => ({
+ trigger: <PlusSquareOutlined />,
items: [
{
label: 'Operation 1',
key: 'operation1',
icon: <EditOutlined />,
},
{
label: 'Operation 2',
key: 'operation2',
icon: <StopOutlined />,
disabled: true,
},
{
label: 'Operation 3',
key: 'operation3',
icon: <DeleteOutlined />,
danger: true,
},
],
onClick: (menuInfo) => {
message.info(`Click ${conversation.key} - ${menuInfo.key}`);
},
}); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
为Conversations 组件增加自定义操作功能,以支持菜单按钮的修改以及其他用户功能的实现(例如置顶等)。

#592
Motivation
1、需要可修改memu icon。
2、可以自定义 actions。
3、memu 和 自定义actions可以换顺序。
API
interface
actions
Conversation) => MenuProps)menu: MenuProps
新增
icon?: ReactNodedescribe
目前actions仅有menu操作,考虑后续扩展同时返回了 oriNode 和 components
usage
snapshot
0 votes ·
Beta Was this translation helpful? Give feedback.
All reactions