如何在 Ionic 4 应用程序的屏幕底部隐藏加载 JS 文件的文本?

问题描述

我在 Ionic 应用程序中使用 MathJax 库。在 index.html 文件中我放了 -

<script type="text/x-mathjax-config">
 MathJax.Hub.Config({
  showProcessingMessages: false,tex2jax: { inlineMath: [['$','$'],['\\(','\\)']] }
 });
</script>

<script type="text/javascript" async src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_HTMLorMML">

在我的在线测试页面中 -

ionViewDidEnter() {
 eval('MathJax.Hub.Queue(["Typeset",MathJax.Hub])');
}

当我进入在线测试页面时,我可以看到 JS 文件正在底部加载。我希望这些文件后台加载而不显示这些文本。我附上了截图以便更好地理解。谢谢! Online-test screen with JS files loading texts

解决方法

messageStyle 选项设置为 'none'

<script type="text/x-mathjax-config">
 MathJax.Hub.Config({
  messageStyle: 'none',tex2jax: { inlineMath: [['$','$'],['\\(','\\)']] }
 });
</script>

有关详细信息,请参阅 documentation