yimo-vue-editor
Demo address: https://vue-editor.yimo.link/example/html/index.html
Vue-editor component based on wangeditor2.5.11 wrapper wangEditor docs:https://www.kancloud.cn/wangfupeng/wangeditor2/113961
Used in vue projects
npm install yimo-vue-editor --save
<template>
<yimo-vue-editor v-model="text></yimo-vue-editor>
</template>
import YimoVueEditor from 'yimo-vue-editor'
export default {
components: {
YimoVueEditor
}
}
Global introduction and configuration
Vue
Parameter
- value v-model Binding editor value
- config wangEditor2.0 config ,wangEditor docs
- uploadHandler
The processing of the return value after the image is uploaded, successfully returns the url to be inserted, fails to return an error prompt or prompts in the hook, etc.var {if type === 'success'var res = JSONif resstatus !== 1return nullreturn resdatafileUrlelse if type === 'error'//todo toastelse if type === 'timeout'//todo toastreturn 'upload failed__'}
Modification
- delete Map menu code
- hide Emoticon menu
- fix Upload multiple image insertion order issues (replace after tag placement)
- add Link open state setting
- add Hook after uploading
- add upload append filename no null
- add fullscreen scroll bar
Points to pay attention to
- ie9 upload image, upload using form+iframe, can't cross domain, and the return type needs to be text/html
- The log is printed as a global parameter, subject to the last setting