1. Tinymce中文手册官网地址
2. 在template中添加富文本组件
<tinymce v-model="noticeForm.content"
:toolbar="[ 'bold italic underline strikethrough alignleft aligncenter alignright alignjustify bullist numlist styleselect removeformat hr subscript superscript formatselect fontselect fontsizeselect forecolor backcolor preview anchor pagebreak insertdatetime table emoticons charmap fullscreen']"
:menubar="'file edit view format '"
/>
其中所有入参的参数,都需要在组建inti方法中初始化,不然入参没有用
Tinymc初始化实例:
tinymce.init({
selector: 'textarea',
toolbar: 'undo redo | styleselect | bold italic | link image',
menubar: 'file edit'
});
TinyMCE默认的工具栏按钮列表:
lineheight(行高 5.5新增)
newdocument(新文档)
bold(加粗)
italic(斜体)
underline(下划线)
strikethrough(删除线)
alignleft(左对齐)
aligncenter(居中对齐)
alignright(右对齐)
alignjustify(两端对齐)
styleselect(格式设置)
formatselect(段落格式)
fontselect(字体选择)
fontsizeselect(字号选择)
cut(剪切)
copy(复制)
paste(粘贴)
bullist(项目列表UL)
numlist(编号列表OL)
outdent(减少缩进)
indent(增加缩进)
blockquote(引用)
undo(撤销)
redo(重做/重复)
removeformat(清除格式)
subscript(下角标)
superscript(上角标)
默认menubar控件:
lineheight(行高 5.5新增)
newdocument(新文档))
undo(撤销))
redo(重做/重复)
visualaid(网格线)
cut(剪切)
copy(复制))
paste(粘贴))
selectall(全选)
bold(加粗))
italic(斜体))
underline(下划线))
strikethrough(删除线))
subscript(下角标))
superscript(上角标))
removeformat(清除格式))
formats(格式)