【问题标题】:Alert showing html code as text in Ionic 4在 Ionic 4 中将 html 代码显示为文本的警报
【发布时间】:2018-11-13 23:10:45
【问题描述】:

此代码适用于 Ionic 3,但在 Ionic 4 beta 12 中仍然无法正常工作。这是一个错误吗?我应该报告吗?如何?我阅读了 beta 文档,它没有说明如何配置如何将文本呈现为 html。

async showRules() {
    const alert = await this.alertController.create({
      header: 'Rules',
      subHeader: `<!--<div class="padding">-->




Brain Builder is up to date with the most recent research regarding IQ enhancement.
As the most recent research suggest, Brain Builder will increase the number of stimulus first (position, audio, color, etc.).
Once all stimuli have been mastered, the n-back will be increased.




    <h3 class="title">
        <center>
Rules for beginners
        </center>
    </h3>


    <p>
A blue square will be shown every three seconds, press the button ‘Position’ when you find that the actual position of the blue square matches with that of the previous one.
The position of the square is accompanied with the pronunciation of a number and the very same rule applies for the sound.
    </p>

`,
      buttons: ['OK'],
      backdropDismiss: false
    });
    await alert.present();
  }

【问题讨论】:

  • 您在 subHeader 中插入了巨大的文本和 html。你应该改用消息

标签: ionic-framework ionic4


【解决方案1】:

我在[Ionic Project Issues Section][1] 中没有看到与此相关的未解决问题

我建议在那里创建一个问题并对其进行监控,直到 Ionic 4 退出测试版并投入生产。

这是创建 Ionic Bug 报告的链接

https://github.com/ionic-team/ionic/issues/new?template=bug_report.md

编码愉快!

-特洛伊

【讨论】:

  • 能否请您发布链接以打开问题?
猜你喜欢
  • 2019-04-16
  • 2018-07-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多