如何更改删除确认对话框标题? [英] How to change the delete confirmation dialog title?
本文介绍了如何更改删除确认对话框标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
删除确认对话框显示资源名称和#id 作为标题.如何将此标题更改为设置了 undoable={false} 的 Edit 对象中定义的标题?
The delete confirmation dialog show the resource name and #id as title. How to change this title to the one defined in Edit object where undoable={false} is set ?
对于批量删除确认对话框,它采用资源名称而不是资源标签,如何也改变这种行为?
And for the bulk delete confirmation dialog it takes the resource name instead of the resource label, how to also change this behavior ?
推荐答案
DeleteButton/BulkDeleteButton 组件具有confirmTitle/confirmContent 属性,您可以在那里设置自己的标题和内容:
The DeleteButton / BulkDeleteButton components have the confirmTitle / confirmContent properties, there you can set your own title and content:
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 />} />
这篇关于如何更改删除确认对话框标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文