reactjs - 用“其他文本”或“图标”覆盖材料表头上的文本“操作”
问题描述
我正在使用 ReactJs 处理材料表,我需要列标题上的文本“Actions”才能用其他文本或任何其他图标覆盖该操作
请需要你们帮助来实现它
例子
实际 - 名字 | 姓氏 | 行动
需要 - 名字 | 姓氏 | 其他文本或图标(用于操作)
const actions = [ { icon: "edit", tooltip: "Edit Order" } ];
const components = {
Action: props => (
<ProposalListMenu
row={props.data}
editAction={this.props.editAction}
handleViewProposal={this.handleViewProposal}
globalSearch={false}
proposalId={this.state.proposalId}
showGenerateOrder={this.state.showGenerateOrder}
handleGenerateOrderPopUp={this.handleGenerateOrderPopUp}
handleGenerateOrderClose={this.handleGenerateOrderClose}
showGeneratedOrderList={this.props.showGeneratedOrderList}
{...this.state}
></ProposalListMenu>
),
Toolbar: props => (
<div>
<MTableToolbar {...props} />
<div style={{ padding: "0px 10px", "text-align": "right" }}>
<ColumnConfigure
columns={this.state.columns}
toggleColumn={this.handleTableColumnConfig}
resetAllColumn={this.handleResetAllColumns}
openFlag={this.state.openFlag}
/>
</div>
</div>
)
};
return {
title: title,
options: options,
actions: actions,
components: components
};
解决方案
覆盖标题actions: 'Actions'
“操作”
修改材料表本地化设置
https://material-table.com/#/docs/features/localization
header: {
actions: 'Actions' // actions: 'Any text'
},
推荐阅读
- xcode - React-Native 中的高 CPU 使用率
- go - Go中特定类型的调用函数
- python - 使用 requests_mock 和 pytest 模拟 botocore.vendored 请求
- callgrind - 如何在 linux 或 cirrus 上安装 kcachegrind?
- c - 给数组一个更大的值不会增加它的大小?
- c# - Visual Studio 2015 项目无法调试
- c++ - 为什么使用移动构造函数而不是复制构造函数?
- javascript - 如何根据另一个选择中的所选选项更改选择中的选项
- bash - 在bash中连接CSV文件只保留一次标题
- c# - c# 在转发器控件中使用 Calendar.SelectedDate,但月份给了我“00”