支持圖片格式和 emoji ,可通過editor.customConfig.emotions配置。
```
<div id="div1">
<p>歡迎使用 wangEditor 富文本編輯器</p>
</div>
<script type="text/javascript" src="/wangEditor.min.js"></script>
<script type="text/javascript">
var E = window.wangEditor
var editor = new E('#div1')
// 表情面板可以有多個 tab ,因此要配置成一個數組。數組每個元素代表一個 tab 的配置
editor.customConfig.emotions = [{
// tab 的標題
title: '新浪',
// type -> 'emoji' / 'image'
type: 'image',
// content -> 數組
content: [{
alt: '壞笑',
title: '壞笑',
src: 'https://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/4d/2018new_huaixiao_org.png'
}, {
alt: '頂',
title: '頂',
src: 'https://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/ae/2018new_ding_org.png'
}, {
alt: "微笑",
title: "微笑",
src: 'https://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/e3/2018new_weixioa02_org.png'
}, {
alt: '拜拜',
title: '拜拜',
src: 'https://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/fd/2018new_baibai_thumb.png'
}, {
alt: '笑cry',
title: '笑cry',
src: 'https://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/4a/2018new_xiaoku_org.png'
}, {
alt: '饞嘴',
title: '饞嘴',
src: 'https://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/fa/2018new_chanzui_org.png'
}]
}, {
// tab 的標題
title: 'emoji',
// type -> 'emoji' / 'image'
type: 'emoji',
// content -> 數組
content: '?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??'.split(/\s/)
}]
editor.create()
```
溫馨提示:需要表情圖片可以去 https://api.weibo.com/2/emotions.json?source=1362404091 和 http://yuncode.net/code/c_524ba520e58ce30 逛一逛,或者自己搜索(請注意表情的版權)。