Wiris编辑器在React组件中使用时缺少图标 [英] Wiris editor missing icons when used in React component

查看:96
本文介绍了Wiris编辑器在React组件中使用时缺少图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在React组件中使用Wiris数学编辑器。我正在 componentDidMount函数中初始化编辑器:

I am trying to use the Wiris mathematics editor within a React component. I am initialising the editor within the "componentDidMount" function:

componentDidMount() {
 var script = document.createElement("script");
 script.src = "https://www.wiris.net/demo/editor/editor";

 var callback = function() {
    var editor = com.wiris.jsEditor.JsEditor.newInstance({
        language: "en"
        });

     editor.insertInto(document.getElementById("editorContainer"));
 };

 script.onload = callback;

 document.head.appendChild(script);
}

但是,当编辑器被渲染时,会出现许多符号失踪。见下文:

However when the editor gets rendered it has an issue where many of the symbols are missing. See below:

我不确定导致此问题。是因为我引用外部脚本的方式,还是React呈现内容的方式的问题?

I am not sure what is causing this issue. Is it because of the way I am referencing the external script, or is it an issue with the way that React is rendering the content?

我在CodePen 此处

I've recreated the issue in a CodePen here.

请注意,如果您在Chrome浏览器(版本59.0.3071.115(正式版本)(64位))或IE 11(11.0.14393.0)中打开该CodePen,则会看到问题。但是,它似乎确实可以在Firefox 54.0.1中使用。

Note that if you open that CodePen in Chrome (Version 59.0.3071.115 (Official Build) (64-bit)) or IE 11 (11.0.14393.0) you will see the problem. However it does appear to work in Firefox 54.0.1.

推荐答案

Wiris开发人员在17年11月解决了此问题。

The Wiris developers fixed this issue in Nov '17.

我将问题悬而未决,因为CodePen对于研究Wiris的React开发人员可能有用!

I've left the question open as the CodePen might be useful to React developers investigating Wiris!

这篇关于Wiris编辑器在React组件中使用时缺少图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆