目前,我的CKEditor5的默认高度只有一行.是否可以使用多行或某些像素或vh或%设置默认高度?
示例图像:

当前代码:
<CKEditor
config={{
extraPlugins: [uploadPlugin],
}}
editor={ClassicEditor}
data=""
onChange={(event, editor) => {
const data = editor.getData();
setEnteredContent(data); //this part for useState
}}
/>发布于 2022-10-16 10:48:38
使用onReady方法
<CKEditor
data={form.values[fieldName]}
editor={ClassicEditor}
config={config}
onChange={DescriptionChangeHandler}
className="sarampeema"
onReady={editor => {
editor.editing.view.change(writer => {
writer.setStyle('height', '100px', editor.editing.view.document.getRoot());
// you can add style here whatever you want for example:
writer.setStyle('z-index','999999 !important',editor.editing.view.document.getRoot());
});
}}
/>https://stackoverflow.com/questions/72977239
复制相似问题