首页 > 解决方案 > 用“其他文本”或“图标”覆盖材料表头上的文本“操作”

问题描述

我正在使用 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
};

};在此处输入图像描述

标签: reactjsmaterial-table

解决方案


覆盖标题actions: 'Actions' “操作”
修改材料表本地化设置

https://material-table.com/#/docs/features/localization

header: {
            actions: 'Actions' //  actions: 'Any text'
        },

推荐阅读