-
Notifications
You must be signed in to change notification settings - Fork 21
Description
// 声明编辑器实例,必须用 shallowRef
const editorRefI = shallowRef()
const editorRefII = shallowRef()
const editorConfig: Partial = { // TS 语法
MENU_CONF: { }
}
editorConfig.MENU_CONF['uploadImage'] = {
server: '/api/upload-img',
// server: '/api/upload-img-10s', // test timeout
// server: '/api/upload-img-failed', // test failed
// server: '/api/xxx', // test 404
timeout: 5 * 1000, // 5s
fieldName: 'custom-fileName',
meta: { token: 'xxx', a: 100 },
metaWithUrl: true, // join params to url
headers: { Accept: 'text/x-json' },
maxFileSize: 10 * 1024 * 1024, // 10M
base64LimitSize: 5 * 1024, // insert base64 format, if file's size less than 5kb
}
const handleCreatedI = (editor: any) => {
editor.config = editorConfig
editorRefI.value = editor
};// 记录 editor 实例,重要!
const handleCreatedII = (editor: any) => editorRefII.value = editor;// 记录 editor 实例,重要!