我有默认按钮文本的Modal。我需要更改它们,但okButtonProps.children和cancelButtonProps.children不起作用。
<Modal
okButtonProps={{
children: "Custom OK"
}}
cancelButtonProps={{
children: "Custom cancel"
}}
>
Modal content
</Modal>发布于 2020-01-20 21:08:49
您必须使用okText和cancelText属性:
<Modal
visible={true}
okButtonProps={{
children: "Custom OK"
}}
cancelButtonProps={{
children: "Custom cancel"
}}
okText="Hello"
cancelText="Ciao"
/>okButtonProps和cancelButtonProps将放置props操作,这些操作将在按下ok按钮或按下cancel按钮时发生。
它们不是用来放置文本的,而是用来放置动作的。
要使用okText和cancelText放置文本,只需检查接口:
https://stackoverflow.com/questions/59823922
复制相似问题