-
Notifications
You must be signed in to change notification settings - Fork 201
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
how to set base url for tinymce-vue #34
Comments
There's no baseURI setting that can change which tinymce is loaded, the easiest way to do what you want to do would be to add a script tag linking in the CDN you want to use before you load the editor vue application. |
@fyrkant I find there are properties called baseURI and baseURL in official docs: https://www.tiny.cloud/docs/api/tinymce/tinymce.editormanager/#properties, |
Those are properties on the editor object, not settings - so stuff you can read but not set. Is there a reason why you can't add a script tag? You have to add a script tag already for the vue app, right? Other than a script tag you can try to bundle the editor into your javascript bundle, but that is a bit more work to get working, you have to host the skin files and so on. |
@fyrkant thanks, I just make it work. |
You can still use v-model even if you load tinymce with a script tag, if you just load TinyMCE with a script tag before you load your vue application the tinymce-vue component will use the tinymce you have made available with the script tag instead of auto-loading from the TinyMCE Cloud. |
@fyrkant thank you very much. |
现在是2021年了,哥们,我也遇到了和你一样的问题,我需要在局域网中使用tinymce,请问您解决了这个cdn加载问题了吗?我还使用了一些插件好像也是从外网加载的.@zmqcherish |
I use tinymce-vue component Editor like below:
<editor v-model="article.content" api-key="***" :init="editorConfig"></editor>
and it auto download tinymce.min.js from https://cloud.tinymce.com/stable/tinymce.min.js.
But sometime it may download fail.(In China, you know...).
So, how to set my own base url to download the script and other related js file.
I try to add the baseURI in my editorConfig, but it can not work:
editorConfig: { baseURI: 'https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.8.3/', height: 330, plugins: "image link", // some other settings }
on the mounted set also can not work:
window.tinymce.baseURL = 'https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.8.3/';
The text was updated successfully, but these errors were encountered: