相关疑难解决方法(0)

HTML 标签在 Ionic 5 警报文本中不起作用

我已将以下代码从 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 中设置警报中的文本样式。

html alert ionic-framework ionic5

4
推荐指数
1
解决办法
3258
查看次数

标签 统计

alert ×1

html ×1

ionic-framework ×1

ionic5 ×1