一。引入样式
<!-- Include Editor style. -->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />
<!-- Include Editor JS files. -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script>
<!-- 语言包 -->
<script type="text/javascript" src="/static/admin/js/zh_cn.js"></script>
二。使用对象
<div role="tabpanel" class="tab-pane" id="detail">
<textarea name="content" id="content" cols="100" rows="8"></textarea>
</div>
三。定义富文本编译器配置
<script>标签:bold,编译器,italic,gin,文本,redo,underline From: https://www.cnblogs.com/lunar-huazai/p/17197701.html
new FroalaEditor('#content',{
height: 300,
language: 'zh_cn', //使用语言包首先需要引入,还要注意下划线
//自定义标题
toolbarButtons: [ ['undo', 'redo'], ['bold', 'italic', 'underline', 'strikethrough', 'subscript', 'superscript', 'outdent', 'indent', 'clearFormatting', 'insertTable', 'html'] ],
toolbarButtonsXS: [ ['undo', 'redo'], ['bold', 'italic', 'underline'] ]
});
</script>