使用插件autoresize
window.tinymce.init({
selector: `#${this.tinymceId}`,
language: 'zh_CN',
height: this.height,
body_class: 'panel-body ',
object_resizing: false,
toolbar: this.toolbar.length > 0 ? this.toolbar : toolbar,
menubar: this.menubar,
plugins: 'autoresize',
autoresize_bottom_margin: 50,
autoresize_max_height: 650, // 编辑区域的最大高
autoresize_min_height: 350, //编辑区域的最小高度
autoresize_on_init: true,
autoresize_overflow_padding: 50,
end_container_on_empty_block: true
})
详细信息参考
https://www.tinymce.com/docs/plugins/autoresize/
网友评论