css - 在 Vue.js 中设置 CKEditor 高度
问题描述
我ckeditor5
在 Vue.js 中尝试,遇到了无法手动设置高度的问题,下面是我的代码,如果我做错了什么,请告诉我。
<ckeditor :editor="editor" v-model="editorData" :config="editorConfig"></ckeditor>
data() {
return {
editor: Editor,
editorData: '',
editorConfig: {
height: '500px'
}
}
解决方案
经典编辑器(CKEditor 5)不再将编辑区域封装在一个 中,这意味着可以使用 CSS 轻松控制编辑区域的高度(和类似选项)。例如,可以通过以下方式实现高度设置:
<style>
.ck-editor__editable {
min-height: 500px;
}
</style>
或者
.ck-content { height:500px; }.
2020 注意:使用单页 Vue 组件时,不要限定要添加到 ckeditor 的 CSS,因为它的元素是与 Vue 分开呈现的,并且没有向它们添加任何数据属性。换句话说, 不 要这样做,因为它不起作用:
<style scoped> /* don't add "scoped"; note that this will also globalize the CSS for all editors in your project */
.ck-editor__editable {
min-height: 5000px;
}
</style>
推荐阅读
- r - 如何在闪亮的所有行中制作相同高度的数据表并在鼠标悬停时查看长文本内容
- angular - 如何为生产构建 angularfire2
- angular - 缺少模块的依赖项引用
- php - mysql中的条件插入或更新
- ios - 从 Firebase 检索字典是“零”
- javascript - 测试 this.props.navigation
- php - 试图在单个帖子页面上获取非对象错误的属性
- marklogic - 主机倾斜 37 秒,XDMP-CLOCKSKEW
- angular - 如何在 Angular Universal 中提供图像
- postscript - postscript 定义字符串变量