我是用webpack在单文件vue文件中用的tinymce,之前正常没问题,但是vue升级了2.5,tinymce升级到4.7.1后报错如下,不知道什么问题:
Uncaught module [tinymce.core.ui.Api] returned undefined
代码如下
<template>
<div>
<Card shadow>
<textarea class='tinymce-textarea' id="tinymceEditer"></textarea>
</Card>
</div>
</template>
<script>
import tinymce from 'tinymce';
export default {
mounted () {
this.$nextTick(() => {
var height = document.querySelector('.single-page-con').offsetHeight - 250;
tinymce.init({
selector: '#tinymceEditer',
branding: false,
elementpath: false,
height: height,
language: 'zh_CN.GB2312',
menubar: 'edit insert view format table tools',
theme: 'modern',
plugins: [
'advlist autolink lists link image charmap print preview hr anchor pagebreak imagetools',
'searchreplace visualblocks visualchars code fullscreen fullpage',
'insertdatetime media nonbreaking save table contextmenu directionality',
'emoticons paste textcolor colorpicker textpattern imagetools codesample'
],
toolbar1: ' newnote print fullscreen preview | undo redo | insert | styleselect | forecolor backcolor bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image emoticons media codesample',
autosave_interval: '20s',
image_advtab: true,
table_default_styles: {
width: '100%',
borderCollapse: 'collapse'
}
});
});
},
destroyed () {
tinymce.get('tinymceEditer').destroy();
}
};
</script>
请赐教
把更新后的theme文件夹替换了一下就好了