这怎么可能向ckeditor5添加新的上传器功能,例如上传音频或视频?
我尝试使用ckeditor5文档,但目前还不清楚。 我将这个vue文件用于ckeditor5。在此文件中,我为项目使用了自定义的uploadadapter,但是现在我不知道如何以这种态度上传其他类型的文件,例如音频和视频
<script>
import ClassicEditor from '@ckeditor/ckeditor5-build-classic/build/ckeditor';
import MyUploadAdapter from '../adapter/UploadAdapter';
export default {
data() {
return {
instance: null,
article: {
data: '',
},
}
},
mounted() {
this.initialize();
},
methods: {
// Initializing Editor
initialize: function () {
ClassicEditor
.create(document.querySelector("#editor"), this.config)
.then(editor => {
// get initial instance object of editor
this.instance = editor;
// set initial binder of editor on start
editor.model.document.on('change', () => {
this.valueBinder(editor.getData())
});
editor.plugins.get('FileDialogButtonView')
// This place loads the adapter.
editor.plugins.get('FileRepository').createUploadAdapter = (loader, article) => {
return new MyUploadAdapter(loader, this.article);
}
})
.catch(error => {
console.error(error);
});
},
}
},
}
</script>