html - TinyMCE 编辑器高度不会改变
问题描述
我是 tinymce 的新手,并使用带有 angularJS 的编辑器。我正在使用 tinymce 库 4.3.13 使用以下 HTML 和 angularJS 代码生成 tinymce 编辑器。在 UI 中渲染编辑器时,高度变得非常小(75 像素),它不会在 tinymceOptions 对象中设置分配的高度。尝试了许多解决方案,但无法提出解决方案。非常感谢任何帮助。
<textarea class="form-control" ui-tinymce="tinymceOptions" rows="16" required></textarea>
$scope.tinymceOptions = {
plugins: [
'autoresize advlist autolink lists link image charmap print preview hr anchor pagebreak',
'searchreplace wordcount visualblocks visualchars code fullscreen',
'insertdatetime media nonbreaking save table contextmenu directionality',
'emoticons template paste textcolor colorpicker textpattern imagetools codesample'
],
autoresize_bottom_margin : 5,
menubar:false,
statusbar: false,
toolbar: 'undo redo cut copy paste pastetext alignleft aligncenter alignright alignjustify bullist numlist outdent indent bold italic underline strikethrough formats removeformat fontselect fontsizeselect forecolor backcolor link hr',
height: 400,
width: 1200,
theme: 'modern',
};
解决方案
tinymce.init({
selector: "textarea", // change this value according to your HTML
plugins: "autoresize",
selector: '#editor',
selector: 'textarea', // change this value according to your HTML
autoresize_min_height: 100,
autoresize_max_height: 1000,
autoresize_bottom_margin: 0,
allow_conditional_comments: true
});
推荐阅读
- svg - 为什么 xlink 与 svg 一起使用,而不是仅使用图像标签?
- amazon-web-services - AWS Api Gateway 使用消息属性连接到 SQS
- sql - 将数据从一个表复制到另一个 postgresql
- django - Django admin - 在列表显示中同时编辑多个值
- angular - Angular创建空模型
- c# - 使用 RestSharp 反序列化带有子元素的 OData 类型 JSON
- angular - 无法绑定数据源,因为它不是表的已知属性 - angular4
- excel - 如何将此一维数组转置到另一个工作表?
- mongodb - Kafka 与 mongo oplog 连接
- html - 使用引导程序将复选框与其他输入组件垂直居中