- Notifications
You must be signed in to change notification settings - Fork9
Vue-editor component modified and encapsulated based on wangeditor2.5.11 source code
License
NotificationsYou must be signed in to change notification settings
yimogit/yimo-vue-editor
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Demo address:https://vue-editor.yimo.link/example/html/index.html
Vue-editor component based on wangeditor2.5.11 wrapperwangEditor docs:https://www.kancloud.cn/wangfupeng/wangeditor2/113961
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 }}
importYimoVueEditorfrom'yimo-vue-editor'Vue.use(YimoVueEditor,{name:'v-editor-app',//Custom nameconfig:{uploadImgUrl:'/api/upload',// upload apiprintLog:false,// disabled console.loguseLang:'en'// lang config},//wagnEditor configuploadHandler:(type,resTxt)=>{//Upload processing hookif(type==='success'){varres=JSON.parse(resTxt)//Do not process the default look at the return value bit image pathif(res.status!==1){returnnull}returnres.data}elseif(type==='error'){//todo toast}elseif(type==='timeout'){//todo toast}return'upload failed__'}})
- valuev-model Binding editor value
- configwangEditor2.0 config ,wangEditor docs
- uploadHandlerThe 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.
varuploadHandler=(type,resTxt)=>{if(type==='success'){varres=JSON.parse(resTxt)if(res.status!==1){returnnull}returnres.data.fileUrl}elseif(type==='error'){//todo toast}elseif(type==='timeout'){//todo toast}return'upload failed__'}
- 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
- 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
About
Vue-editor component modified and encapsulated based on wangeditor2.5.11 source code
Resources
License
Stars
Watchers
Forks
Packages0
No packages published