vue-ckeditor5-classic
v3.0.1
Published
- 支持一下
Downloads
471
Readme
toolbar数组
- 支持一下
'sourceEditing',
'importWord',
'exportWord',
'exportPdf',
'|',
'heading',
'|',
'fontSize',
'fontFamily',
'fontColor',
'fontBackgroundColor',
'|',
'bold',
'italic',
'underline',
'strikethrough',
'subscript',
'superscript',
'code',
'|',
'horizontalLine',
'link',
'insertImage',
'mediaEmbed',
'insertTable',
'blockQuote',
'|',
'alignment',
'|',
'bulletedList',
'numberedList',
'todoList',
'outdent',
'indent',
'Undo',
'Redo'
shouldNotGroupWhenFull
toolbar是否换行
licenseKey
申请的key 默认GPL
fontFamily
设置字体
语言
language
使用
CKEditor.create(editorDom.value, editorConfig.value)
.then((editor: any) => {
editor.setData(props.value)
//自定上传
editor.plugins.get('FileRepository').createUploadAdapter = (loader: any) => {
return new UpdateFile(loader)
}
//监听值的变化
editor.model.document.on('change:data', function () {
compValue.value = editor.getData();
emit('update:value', compValue.value);
})
myEditor = editor;
})
.catch((error: any) => {
console.error(error)
})
}
class UpdateFile {
loader: any;
constructor(loader: any) {
// Save Loader instance to update upload progress.
this.loader = loader
}
async upload() {
const data = new FormData()
data.append("file", await this.loader.file)
return new Promise((resolve, reject) => {
http.upload(data).then((apiData: any) => {
let resData = apiData.data;
resData.default = '文件路径'
resolve(resData)
});
})
}
}