脚本宝典收集整理的这篇文章主要介绍了tinymce 5更新后,如何使用tinymce-vue,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
项目使用vue-cli 3.x版本,tinymce5
npm install @tinymce/tinymce-vue
出现的问题和摸索出的解决方案(参考了https://www.cnblogs.com/wisewrong/p/8985471.html,虽然文章里使用的是tinymce4,但是也有很大帮助)
npm install tinymce
theme.js:1 Uncaught SyntaxError: Unexpected token <
”这个错,需要手动引入tinymce主题,在inIT({})方法里加theme: 'silver',
没用。import 'tinymce/themes/silver/theme'
skin: "oxide"
没用。先在Public目录下新建一个文件夹命名为tinymce,然后在node_modules里找到tinymce的skin包,复制到public/tinymce里,然后创建tinymce时添加一行代码skin_url: '/tinymce/skins/ui/oxide',
步骤:
language_url: `/tinymce/langs/zh_CN.js`,
language: 'zh_CN',
const that = this
this.tinymceinit = {
toolbar: 'imageUpload',
SETUP: (editor) => {
editor.ui.registry.addButton('imageUpload', {
tooltip: '插入图片',
icon: 'image',
onAction: () => {
}
})
}
}
详细例子在我的github项目里https://github.com/Inspiration1/asteroid
以上是脚本宝典为你收集整理的tinymce 5更新后,如何使用tinymce-vue全部内容,希望文章能够帮你解决tinymce 5更新后,如何使用tinymce-vue所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。