# 配置表情
`v3.0.15`開始支持配置表情,支持圖片格式和 emoji ,可通過`editor.customConfig.emotions`配置。**注意看代碼示例中的注釋:**
```html
<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: '[壞笑]',
src: 'http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/50/pcmoren_huaixiao_org.png'
},
{
alt: '[舔屏]',
src: 'http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/40/pcmoren_tian_org.png'
}
]
},
{
// tab 的標題
title: 'emoji',
// type -> 'emoji' / 'image'
type: 'emoji',
// content -> 數組
content: ['??', '??', '??', '??', '??']
}
]
editor.create()
</script>
```
溫馨提示:需要表情圖片可以去 https://api.weibo.com/2/emotions.json?source=1362404091 和 http://yuncode.net/code/c_524ba520e58ce30 逛一逛,或者自己搜索。
- 介紹
- 開始使用
- 創建一個編輯器
- 使用JS模塊定義
- 菜單和編輯區域分離
- 單頁面多個編輯器
- 禁用編輯器
- 內容處理
- 設置內容
- 獲取內容
- 使用textarea
- 獲取JSON
- 參數配置
- 配置菜單
- debug模式
- onchange
- 配置編輯區域z-index
- 多語言
- 粘貼文本
- 插入網絡圖片回調
- 插入鏈接的校驗
- 插入網絡圖片的校驗
- onfocus
- onblur
- 配置顏色
- 配置表情
- 配置字體
- 上傳圖片
- tab顯示和隱藏
- base64格式保存圖片
- 上傳圖片到服務器
- 上傳到七牛云存儲
- 其他
- 全屏-預覽-查看源碼
- 上傳附件
- 關于markdown
- xss攻擊
- 用于React
- 用于Vue
- 用于angular
- 常用API