contentco / quill-emoji

Quill module toolbar extension for emoji
274 stars 166 forks source link

can't import / register module (toolbar) #101

Open philharmonie opened 4 years ago

philharmonie commented 4 years ago

I followed the docs step by step. I added to my :

<!-- Main Quill library -->
<script src="//cdn.quilljs.com/1.3.6/quill.js"></script>
<script src="//cdn.quilljs.com/1.3.6/quill.min.js"></script>

<!-- Theme included stylesheets -->
<link href="//cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
<link href="//cdn.quilljs.com/1.3.6/quill.bubble.css" rel="stylesheet">

<!-- Core build with no theme, formatting, non-essential modules -->
<link href="//cdn.quilljs.com/1.3.6/quill.core.css" rel="stylesheet">
<script src="//cdn.quilljs.com/1.3.6/quill.core.js"></script>

Then I added two container:

div id="toolbar"></div>
<div class="quill"></div>

after that I added:

<script>

    var editor = new Quill('.quill', {
        modules: {
            toolbar: '#toolbar'
        }
    });
</script>

The editor in the .quill class is loading but I am getting:

and the Toolbar is not loading.

To resolve it on my own I tried the npm install and copied the dist folder and the modules folder to my project and switched my code to:

<script>
    Quill.register('modules/toolbar');
    var editor = new Quill('.quill', {
        modules: {
            toolbar: '#toolbar'
        }
    });
</script>

ending with: