gpt4 book ai didi

javascript - React Material UI 表添加自定义按钮

转载 作者:行者123 更新时间:2023-12-02 21:14:47 24 4
gpt4 key购买 nike

这是一个特定于 MaterialTable 的问题。我已阅读文档和 API,但找不到自定义 Actions 列并添加用于查看详细信息的图标的有效方法。

我正在使用关系数据库,并且希望能够为行上的每个用户链接它。

Add Button after trash can

最佳答案

Material Table documentation指出您可以将一组操作传递给 MaterialTable 组件上的 actions 属性。

数组中的每个操作元素都可以指定字段,其中包括 icononClickicon 可以是自定义组件。

以下是上面链接的文档中的示例:

<MaterialTable
// other props
actions={[
{
icon: 'save',
tooltip: 'Save User',
onClick: (event, rowData) => {
// Do save operation
}
}
]}
/>

关于javascript - React Material UI 表添加自定义按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60999631/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com