如何为ckeditor5设置初始数据?
我找不到有关如何在CKEditor 5中设置初始数据的简单示例。
在某些问题中,据说我们应该使用setData
api。但是这些示例是基于AJAX的。
在CKEditor 4中,我将简单地设置textarea
的value
,仅此而已。
在CKEditor 5中,HTML不是textarea
,而是简单的< div>
。
我试图将内容放入< div>
中,但它不起作用。
我也找不到文档中的示例。
那么,如何在CKeditor 5中设置初始数据?
I can't find a simple example on how to set initial data in CKEditor 5.
In some SO questions, it's said that we should use setData
API. But those examples are AJAX based.
In CKEditor 4, I would simply set the value
of the textarea
and that was it.
In CKEditor 5, the HTML is not textarea
but a simple <div>
.
I tried to put the content inside the <div>
and it did not work.
I also can't find an example in the docs.
So, how can I set initial data in CKEditor 5?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(1)
您可以在初始化期间在配置对象中提供
initiaData
字段。You can provide the
initialData
field in your config object during initialization. Doc reference