|
@@ -26,19 +26,33 @@ onMounted(() => {
|
26
|
26
|
window.tinymce.init({
|
27
|
27
|
selector: '#noteEditor',
|
28
|
28
|
plugins: 'save',
|
|
29
|
+ menubar: false,
|
|
30
|
+ language: 'zh_CN',
|
|
31
|
+ plugins: ['image', 'save'],
|
|
32
|
+ image_description: false, // 禁用图片描述
|
|
33
|
+ image_dimensions: false, // 禁用图片宽高设置
|
|
34
|
+ toolbar: 'blocks fontfamily fontsize bold italic backcolor alignleft aligncenter alignright alignjustify image outdent indent undo redo removeformat',
|
29
|
35
|
setup: (editor) => {
|
30
|
36
|
if (props.modelValue) {
|
31
|
37
|
editor.setContent(props.modelValue)
|
32
|
38
|
}
|
33
|
39
|
|
34
|
|
- editor.on('input', () => {
|
|
40
|
+ editor.on('change', () => {
|
35
|
41
|
emit('update:modelValue', editor.getContent());
|
36
|
42
|
})
|
37
|
|
-
|
38
|
|
- editorRef.value = editor
|
|
43
|
+ },
|
|
44
|
+ init_instance_callback: (editor) => {
|
|
45
|
+ editorRef.value = editor;
|
39
|
46
|
},
|
40
|
47
|
save_onsavecallback: () => {
|
41
|
48
|
emit('save', editorRef.value.getContent())
|
|
49
|
+ },
|
|
50
|
+ images_upload_handler: (blobInfo, progress) => {
|
|
51
|
+ return new Promise((resolve, reject) => {
|
|
52
|
+ // const formData = new FormData();
|
|
53
|
+ // formData.append('file', blobInfo.blob(), blobInfo.filename());
|
|
54
|
+ // uploadImage(formData).then(resolve)
|
|
55
|
+ })
|
42
|
56
|
}
|
43
|
57
|
})
|
44
|
58
|
})
|