页面添加 如下代码(注意标红代码,没必要修改id) <div class="col-sm-11 b-r"> <div class="form-group"> <label class="col-sm-1 control-label">内容</label> <div class="col-sm-11"> <div id="editor" class="editorHeight"> </div> </div> </div> </div>
引入
<script type="text/javascript" src="${ctxPath}/static/js/wangEditor.min.js"></script>
<script src="${ctxPath}/static/modular/articlemodul/article/article_info.js"></script>
在引入的 article_info.js 页面 ,添加如下代码
//初始化编辑器
var E = window.wangEditor;
var editor = new E('#editor');
editor.create();
editor.txt.html($("#contentVal").val());
ArticleInfoDlg.editor = editor;
ArticleInfoDlg.collectData = function() {
this.articleInfoData['content'] = ArticleInfoDlg.editor.txt.html();
this
.set('id')
.set('title')
.set('cover');
}
蓝色代码才是你需要修改的字段,改为你实体字段名称即可