如何更改删除确认对话框标题?

问题描述 投票:0回答:1

删除确认对话框显示资源名称和#id作为标题。如何将此标题更改为在Edit对象中定义的标题(设置了undoable = {false})?

对于批量删除确认对话框,它使用资源名称而不是资源标签,如何也更改此行为?

react-admin
1个回答
0
投票

[DeleteButton / BulkDeleteButton组件具有confirmTitle / confirmContent属性,您可以在其中设置自己的标题和内容:

const MyActions = props => (
  <TopToolbar>
    <DeleteButton
      undoable={false}
      confirmTitle={'My Title'}  // 'resources.my_res.delete.title'
      confirmContent={'My Content'}
    />
  </TopToolbar>
)

const MyBulkActionButtons = props => (
  <>
    <BulkDeleteButton
      undoable={false}
      confirmTitle={'My Title'}
      confirmContent={'My Content'}
      {...props}
    />
  </>
)

<List actions={<MyActions />} bulkActionButtons={<MyBulkActionButtons />} />
<Edit actions={<MyActions />} />
© www.soinside.com 2019 - 2024. All rights reserved.