TinyMCE-6如何设置工具栏默认完全展开?
解决TinyMCE 6工具栏默认展开全部的问题
要让TinyMCE加载时默认显示全部工具栏按钮,无需点击右侧三点展开,只需在配置中添加toolbar_mode: 'wrap'参数即可。
修改后的完整配置示例:
menubar: false, plugins: ['searchreplace', 'link', 'anchor', 'image', 'table', 'charmap','fullscreen','code', 'preview', 'lists','help','wordcount'], toolbar: 'cut copy paste pastetext | undo redo | searchreplace | selectall | link unlink anchor | ' + 'image| table | hr| charmap |fullscreen | code | preview print | ' + 'bold italic underline strikethrough subscript superscript | removeformat |'+ 'numlist bullist | outdent indent | blockquote |alignleft aligncenter alignright alignjustify |'+ 'blocks fontfamily fontsize | forecolor backcolor|help |', toolbar_mode: 'wrap' // 添加该行配置
说明:
toolbar_mode: 'wrap'会让工具栏在空间不足时自动换行,展示所有按钮,不会触发折叠生成三点溢出按钮。- 如果页面容器宽度足够,也可以通过调整编辑器的
width参数给工具栏预留足够横向空间,但toolbar_mode: 'wrap'是适配不同屏幕宽度的通用解决方案。
内容的提问来源于stack exchange,提问作者Mathew Stephen
相关产品推荐
相关产品推荐

