我想在确认函数的标题字段中将一些动态文本显示为粗体,但它给我的是object对象。我怎样才能解决这个问题,请告诉我。
import { Modal} from 'antd'
const { confirm } = Modal
confirm({
title:
'Are you sure you want to delete ' +
<b>{name}</b> +
' ? This action cannot be undone.',
icon: <ExclamationCircleOutlined />,
async onOk() {}
},
onCancel() {
console.log('Cancel')
},
})
}
谢谢
发布于 2022-06-28 06:10:15
title
支柱可以是ReactNode,所以您可以这样做:
const name = "John";
Modal.confirm({
title: <span>Are you sure do yo want to delete this <strong>{name}</strong>?</span>
});
https://stackoverflow.com/questions/72773463
复制相似问题