看官网配置 onchange 函数:https://www.kancloud.cn/wangfupeng/wangeditor3/338872
主要代码:
<script type="text/javascript">
var E = window.wangEditor
var editor = new E('#div1')
var $text1 = $('#text1')
editor.customConfig.onchange = function (html) {
// 监控变化,同步更新到 textarea
$text1.val(html)
}
editor.create()
// 初始化 textarea 的值
$text1.val(editor.txt.html())
</script>
相关链接:
https://ask.fastadmin.net/question/6789.html