软件特点
支持 npm 直接引用
支持响应式,自动缩放
没有官方的实例销毁方案,项目中使用的是作者在github给出的临时方案
支持一个页面多个编辑器
不支持一个页面多个编辑器同时使用地图
后端需要进行相应配置
安装 wangEditor
npm install wangeditor --save
代码引入 wangEditor (vue环境)
#account--editor {
width: 100%;
min-height: 330px;
height: auto;
}
import WangEditor from 'wangeditor';
export default {
data(){
return{
dataInterface: {
editorUpImgUrl: 'http://xxxx' // 编辑器插入的图片上传地址
},
editor: '', // 存放实例化的wangEditor对象,在多个方法中使用
}
},
ready(){
this.createEditor();
},
beforeDestroy(){
this.destroyEditor();
},
methods: {
createEditor(){ // 创建编辑器
this.editor = new W