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

[Others]多实例时使用usePlugin加载mermaid报错,单实例是正常的 #758

Closed
insistence opened this issue May 6, 2024 · 2 comments

Comments

@insistence
Copy link

报错信息为:The function usePlugin should be called before Cherry is instantiated.

if (window.mermaid) {
    Cherry.usePlugin(mermaidPlugin, {
        mermaid: window.mermaid
    })
}
new Cherry({
    ...editorConfig,
    id: containerId,
    value: value,
    externals: {
        katex: katex,
        MathJax: MathJax,
    }
});
@lyngai
Copy link
Collaborator

lyngai commented May 6, 2024

多实例也只需要调用一次 usePlugin。

@insistence
Copy link
Author

哦我懂了,已解决,感谢

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

2 participants