引入:
<link href="~/Content/summernote-master/tam-emoji/css/emoji.css" rel="stylesheet" />
<script src="~/Content/summernote-master/tam-emoji/js/config.js"></script> <script src="~/Content/summernote-master/tam-emoji/js/tam-emoji.js"></script>
使用:
$(document).ready(function () { //emoji图片路径 document.emojiSource = '../../content/summernote-master/tam-emoji/img'; $('#Content').summernote({ height: 400, minHeight: 400, maxHeight: 400, placeholder: "请输入内容", lang: 'zh-CN', dialogsFade: true, //模态框淡入淡出 toolbar: [ ['history', ['undo', 'redo']], ['insert', ['emoji']], //emoji ['style', ['style']], ['font', ['bold', 'underline', 'clear']], ['fontname', ['fontname']], ['color', ['color']], ['para', ['ul', 'ol', 'paragraph']], ['table', ['table']], ['insert', ['link', 'picture']], ['view', ['fullscreen', 'help']], ] }); });
效果图:
附上github地址
https://github.com/trinhtam/summernote-emoji
文章来源: summernote 添加emoji表情包