Search code examples
vue.jsnpmtinymce

TinyMCE Vue Integration SelfHosted


I have a problem with the integration of TinyMCE in a Vue project. The Official TinyMCE Vue.js component (tinymce-vue) works but is only a gateway to request the sources via CDN.

I want to have a self hosted version, but in no case download the sources directly. The tinymce package via npm does not interface properly with Vue.

import tinymce from "tinymce/tinymce";

tinymce.init({ selector: "textarea"}); throws an error :

Uncaught SyntaxError: expected expression, got '<' theme.js:1

I have a textarea in the template

How can I fix this problem? Thanks


Solution

  • I found the solution

    Tinymce-vue package loads tinymce from cloud if tinymce was not included in the project.

    import "tinymce/tinymce";
    import "tinymce/themes/silver";
    import "tinymce/icons/default";
    import "tinymce/skins/ui/oxide/skin.css";
    
    import Editor from "@tinymce/tinymce-vue";
    

    To load local setup of tinymce editor.

    Editor component will also be available