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

Unable to append Component Code Editor to a container DIV #55

Open
protozoo opened this issue Jan 22, 2024 · 2 comments
Open

Unable to append Component Code Editor to a container DIV #55

protozoo opened this issue Jan 22, 2024 · 2 comments

Comments

@protozoo
Copy link

Hi there,

I'm trying to integrate the component-code-editor plugin in my grapes-based app but I can't get it to be displayed.
This is my relevant js code:

// (...)
    plugins: ['grapesjs-component-code-editor'],
    pluginsOpts: {
        'grapesjs-component-code-editor': { appendTo:'#componentCodeEditor' }, 
// (...)

The intended container target is just a div in my page html:

<div id="componentCodeEditor"></div>

And I'm loading the plugin like this:

<link href="https://unpkg.com/grapesjs-component-code-editor/dist/grapesjs-component-code-editor.min.css" rel="stylesheet">
<script src="https://unpkg.com/grapesjs-component-code-editor"></script>

I don't have any other additional code related to integrating/using this plugin besides this.
Am I missing anything? Maybe I need to call some function or command to get it displayed?

Thank you

@flauc
Copy link

flauc commented May 27, 2024

@protozoo I had the same problem, for some reason changing this

// (...)
    plugins: ['grapesjs-component-code-editor'],
    pluginsOpts: {
        'grapesjs-component-code-editor': { appendTo:'#componentCodeEditor' }, 
// (...)

to this

// (...)
    plugins: [
        editor => componentCodeEditor(
          editor,
          {
            appendTo: '#componentCodeEditor'
          }
   ]
// (...)

fixed it for me.

@protozoo
Copy link
Author

I finally went another route but thanks anyway!

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