首頁  >  問答  >  主體

javascript - Antd Modal confirm确认框的content内容允许换行么?

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"

这样尝试发现不行?

应该怎么做呢?

伊谢尔伦伊谢尔伦2748 天前2325

全部回覆(1)我來回復

  • ringa_lee

    ringa_lee2017-04-11 09:44:38

    文档中已经说明了content的类型是element or string, 因此可以:

    content: (<p>Hello <br /> world.</p>)

    回覆
    0
  • 取消回覆