我在 Vue.js 中试用 ckeditor5
,我遇到了一个无法手动设置高度的问题,下面是我的代码,如果我做错了什么请告诉我.
<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>