iview中使用wangEditor

1、下载安装

//(注意 wangeditor 全部是小写字母)
npm install wangeditor

 

2、在iview的单页面中首先引入

import E from "wangeditor";

 

3、在mounted方法中创建实例

 

var editor = new E("#editorElem");
  
editor.customConfig.onchange = html => {
    this.editorContent = html;
};
      
editor.create();

 

 

4、在HTML部分引用
<div id="editorElem" style="text-align:left"></div>
<button v-on:click="getContent">查看内容</button>

 

 


 
 
posted @ 2019-03-06 08:32  shikern  阅读(878)  评论(0编辑  收藏  举报