我已将以下代码从 Ionic 3 迁移到 Ionic 5
const alert = await this.alertCtrl.create({
subHeader: "About" + " <b>" + this.user.name + "</b>",
message: "Test Messgae",
buttons: [
{
text: 'Close',
role: 'cancel',
handler: () => {
}
}
]
});
await alert.present();
Run Code Online (Sandbox Code Playgroud)
在 Ionic 3 中,用户名以粗体显示,但在 Ionic 5 中,HTML 标签不起作用,< b > 标签显示为文本。请建议我如何在 IONIC 5 中设置警报中的文本样式。