页面:index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style type="text/css">
.toolbar {
border: 1px solid #ccc;
}
.text {
border: 1px solid #ccc;
height: 400px;
}
</style>
</head>
<body>
<div id="div1" class="toolbar"></div>
<div style="padding: 5px 0; color: #ccc">请在下方编辑区输入文章文章内容</div>
<div id="div2" class="text">
<!--可使用 min-height 实现编辑区域自动增加高度-->
</div>
<!-- 修改.js目录位置 -->
<script type="text/javascript" src="/js/wangEditor.min.js"></script>
<script type="text/javascript">
var E = window.wangEditor
var editor = new E('#div1', '#div2') // 两个参数也可以传入 elem 对象,class 选择器
// editor.customConfig.uploadImgShowBase64 = true // 使用 base64 保存图片
// 配置服务器端地址
editor.customConfig.uploadImgServer = '/test/upload