<div class="layui-input-block">
<textarea id="content" name="content" required lay-verify="required" placeholder="我要回答" class="layui-textarea fly-editor" style="height: 150px;"></textarea>
</div>js如下 <script>
var layedit , index;
layui.use(['form' , 'layedit'], function(){ var form = layui.form() ;
layedit = layui.layedit;
layedit.set({
uploadImage: {
url: '/topic/upload.html' //接口url ,type: 'post' //默認(rèn)post }
});
index = layedit.build('content',{tool: ['strong', 'italic','underline','del','|','left','center','right','|','link','unlink','face','image','|','code']}); //建立編輯器
});
}); </script>在layedit編輯器里選擇表情后 發(fā)帖后頁面顯示 <img src="http://127.0.0.1:8080/images/face/1.gif" alt="[嘻嘻]">在編輯器里輸入test選擇斜體后 頁面顯示<i>test</i>這種問題如何解決?
使用layui 的富文本編輯器layedit,輸入內(nèi)容后發(fā)貼頁面顯示代碼
米脂
2018-07-31 05:15:39