Antd Modal
import { Modal, Button } from 'antd';
const confirm = Modal.confirm;
function showConfirm() {
confirm({
title: 'Want to delete these items?',
content: 'some descriptions',
onOk() {
console.log('OK');
},
onCancel() {},
});
}
ReactDOM.render(
<Button onClick={showConfirm}>
confirmation modal dialog
</Button>
, mountNode);
content内容是否允许多行。
比如
content: "hello \n world";
或者
content: "hello<br/>world"
这样尝试发现不行?
应该怎么做呢?
文档中已经说明了content的类型是element or string, 因此可以:
content: (<p>Hello <br /> world.</p>)