Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如果作为组件使用的话,当二次编辑的时候,不会再次渲染 #8

Open
loycoder opened this issue Nov 29, 2020 · 0 comments

Comments

@loycoder
Copy link

require('@sugarteam/formula-editor/dist/index.min.css');
require('@sugarteam/formula-editor/dist/npmBundle');
require('@sugarteam/formula-editor/dist/kitygraph.all.min');
require('@sugarteam/formula-editor/dist/kity-formula-render.all.min');
require('@sugarteam/formula-editor/dist/kity-formula-parser.all.min');
require('@sugarteam/formula-editor/dist/kityformula-editor.all.min');

componentDidMount() {
   
    document.addEventListener('documentMessage', this.listener); 
    const factory = window.kf.EditorFactory.create(this.editorRef.current, {
      render: {
        fontsize: 30,
      },
      ui: {
        device: 'pc',
        scale: 1,
        protocol: 'documentEvent',
      }
    });

    factory.ready(function() {
      this.execCommand('render', '\\placeholder');
      this.execCommand('focus');
    });
  }

``
当关闭时,再次打开,dom元素未插入。这样以来,组件只能做不销毁处理,能否优化呢
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant