我正在尝试将CKEditor 5集成在引导模式中,但是即使编辑器在没有任何错误的情况下初始化,我也无法在文本字段中输入。编辑器是渲染的,但表现得好像它处于“只读”模式。

问题描述 投票:0回答:1

然后我运行classiceditor.greate用ckeditor 5 Editor替换Textarea。

ClassicEditor.create($("#texto_contenido")[0], { licenseKey: 'eyJhbGciOiJFUzI1NiJ9.eyJleHAiOjE3NDA1Mjc5OTksImp0aSI6ImNiNjk1OTZhLTM4YzUtNDc2YS1iM2UxLTFmOWU1OTNlMDQ0MCIsInVzYWdlRW5kcG9pbnQiOiJodHRwczovL3Byb3h5LWV2ZW50LmNrZWRpdG9yLmNvbSIsImRpc3RyaWJ1dGlvbkNoYW5uZWwiOlsiY2xvdWQiLCJkcnVwYWwiLCJzaCJdLCJ3aGl0ZUxhYmVsIjp0cnVlLCJsaWNlbnNlVHlwZSI6InRyaWFsIiwiZmVhdHVyZXMiOlsiKiJdLCJ2YyI6IjA4Y2QwYjJiIn0.283faOBt808tzYbU44p9td1uQgmOyNFeVsV_tYEGywdfUZqNXFgzQuKKXm12u9RJoz7WOuEKHoxi_O0zxew0hA', toolbar: { items: ["bold", "italic", "|", "alignment", "|", "undo", "redo"] }, plugins: [Alignment, Bold, Italic, Paragraph, Undo], language: "es" }) .then(editor => { window.editorInstance = editor; }) .catch(error => { console.error(error); });

modal without anything written不可能在编辑器中编写,如果事先编辑了文本区域,则确实需要文本,但是仍然无法编辑任何内容。我显示了一个示例屏幕截图


任何可能导致此问题或如何解决问题的想法? Replacing textarea with CKEditor 5 editor

简报插件

i我能够复制该问题,这是由缺失的ckeditor插件引起的。

exterentials

插件“启用剪贴板,输入,选择全部,Shiftenter,键入和撤消支持。”Example with text demo

代码使用评估许可证密钥,该密钥在14天后停止工作。

javascript jquery bootstrap-modal editor ckeditor5
1个回答
0
投票

const KEY = "eyJhbGciOiJFUzI1NiJ9.eyJleHAiOjE3NDA1Mjc5OTksImp0aSI6ImNiNjk1OTZhLTM4YzUtNDc2YS1iM2UxLTFmOWU1OTNlMDQ0MCIsInVzYWdlRW5kcG9pbnQiOiJodHRwczovL3Byb3h5LWV2ZW50LmNrZWRpdG9yLmNvbSIsImRpc3RyaWJ1dGlvbkNoYW5uZWwiOlsiY2xvdWQiLCJkcnVwYWwiLCJzaCJdLCJ3aGl0ZUxhYmVsIjp0cnVlLCJsaWNlbnNlVHlwZSI6InRyaWFsIiwiZmVhdHVyZXMiOlsiKiJdLCJ2YyI6IjA4Y2QwYjJiIn0.283faOBt808tzYbU44p9td1uQgmOyNFeVsV_tYEGywdfUZqNXFgzQuKKXm12u9RJoz7WOuEKHoxi_O0zxew0hA" const { Essentials, ClassicEditor, Alignment, Undo, Bold, Italic, Font, Paragraph } = CKEDITOR ClassicEditor.create(document.getElementById("texto_contenido"), { licenseKey: KEY, toolbar: { items: ["bold", "italic", "|", "alignment", "|", "undo", "redo"] }, plugins: [Essentials, Alignment, Bold, Italic, Paragraph, Undo], language: "es" }) .then(editor => { window.editorInstance = editor; }) .catch(error => { console.error(error); }); <!-- Button trigger modal --> <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#staticBackdrop" > Open Modal </button> <!-- Modal --> <div class="modal fade" id="staticBackdrop" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true" > <div class="modal-dialog"> <div class="modal-content"> <div class=""> <h1 class="modal-title fs-5" id="staticBackdropLabel"> Editor</h1> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" ></button> </div> <div class="modal-body"> <!-- ckeditor --> <div class="main-container"> <div id="texto_contenido"> <p>Hello from CKEditor 5!</p> </div> </div> </div> <div class="modal-footer"> </div> </div> </div> </div> <!-- jQuery --> <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script> <!-- BOOTSTRAP 5 --> <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" /> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script> <!-- CKEDITOR --> <link rel="stylesheet" href="https://cdn.ckeditor.com/ckeditor5/44.2.1/ckeditor5.css" /> <script src="https://cdn.ckeditor.com/ckeditor5/44.2.1/ckeditor5.umd.js"></script>

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.