我需要将确认对话框消息显示为 html,这就是我的对话框在组件中的外观:
this.confirmationService.confirm({
header: "Change user status",
message: "Do you want to change user status to <strong>" + status + "</strong >?",
accept: () => {
//
}
});
这就是它在页面上的样子:
我尝试用两种方法做到这一点,但没有成功
<p-confirmDialog width="500" appendTo="body">
<template pTemplate="body">
<span class="ui-confirmdialog-message">{{message}}</span>
</template>
<p-confirmDialog width="500" [innerHTML]="message"></p-confirmDialog>
所以这有点旧了,但对于未来 - 解决方案是更改引用类型message
.
所以,改变
message: "Do you want to change user status to <strong>" + status + "</strong >?",
to
message: `Do you want to change user status to <strong>" + status + "</strong >?`,
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)