右键单击 table 行打开上下文菜单
Open context menu on table row right click
是否可以让下拉上下文菜单对整个 Table 行起作用?我们可以使用单元格渲染方法渲染下拉列表,但由于单元格填充,这样它不会覆盖整个 table 单元格。因此,用户必须精确地单击显示的文本,而不是整个单元格。
对于上下文菜单,您可以使用 Dropdown
或 Popover
具有一些 css 自定义的组件,但问题是弹出菜单没有出现在鼠标指针旁边,它相对于包装元素出现。你可以看看here我上面说的
我做了一个自定义的 Popup 组件。它看起来有些丑陋,但无论如何它工作正常。 You can check it here.
For the context menu you can use Dropdown
or Popover
components with some css customization, but the problem is the popup menu doesn't appear next to mouse pointer, it appears relatively to a wrapped element. You can check it here what I ment above.
看来antd已经修复了Dropdown
组件的弹窗位置问题
是否可以让下拉上下文菜单对整个 Table 行起作用?我们可以使用单元格渲染方法渲染下拉列表,但由于单元格填充,这样它不会覆盖整个 table 单元格。因此,用户必须精确地单击显示的文本,而不是整个单元格。
对于上下文菜单,您可以使用 Dropdown
或 Popover
具有一些 css 自定义的组件,但问题是弹出菜单没有出现在鼠标指针旁边,它相对于包装元素出现。你可以看看here我上面说的
我做了一个自定义的 Popup 组件。它看起来有些丑陋,但无论如何它工作正常。 You can check it here.
For the context menu you can use
Dropdown
orPopover
components with some css customization, but the problem is the popup menu doesn't appear next to mouse pointer, it appears relatively to a wrapped element. You can check it here what I ment above.
看来antd已经修复了Dropdown
组件的弹窗位置问题