gpt4 book ai didi

ckeditor - CKEditor 5 的设置值

转载 作者:行者123 更新时间:2023-12-03 13:37:53 25 4
gpt4 key购买 nike

我正在我的网站上开发一个功能,用户应该能够使用 ckeditor 5 和 textarea 编辑他或她自己的主题。 textarea 放置在模态内。但是,当我尝试在用户按下按钮时预填充 textarea 时,textarea 内没有任何内容。我尝试了以下方法:

var editor;
ClassicEditor
.create(document.querySelector('#edit-reply-modal'))
.then(editor => {
editor = editor;
})
$(".toggle-edit-modal").click(function(e) {
e.preventDefault();
editor.setData("<p>Testing</p>"));
$("#edit-reply-modal").html("<p>Testing</p>");
});

任何帮助表示赞赏。

最佳答案

我看到你有一个 ')' 比需要的多 editor.data.set("<p>Testing</p>"));
如果您仍然无法设置数据,请尝试像这样设置数据:

 editor.data.set("<p>Testing</p>");

关于ckeditor - CKEditor 5 的设置值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50877578/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com