通过 Show/Hide 按钮调用时不显示 Quill 内容

Quill Content not displaying when called through Show/Hide Buttons

我有一个初始化的羽毛笔及其所有组件和 CSS。 我的问题是,我的页面上有一个编辑按钮来加载 MySQL 内容。当用户单击编辑按钮时,内容应该可供用户编辑。为此,我使用羽毛笔。 Quill 已完美初始化并显示编辑 space 和工具栏。

但不显示编辑中的内容space。我按要求通过div调用了内容,没有通过textarea,但是不知为何,内容没有显示出来。不知道为什么?

谁能帮我找出原因和可能的解决方案。

<div style="height: 150px;" class="mb-0" data-toggle="quill" data-quill-placeholder="Enter description"> <div><h1>Hello World!</h1> <p>Some initial <strong>bold</strong> text</p> <p><br></p></div> </div>

<script> var editor = new Quill('[data-toggle="quill"]', { modules: { syntax: true, toolbar: true, theme: 'snow' }, placeholder: 'Compose an epic...', theme: 'snow' }); </script>

My Codepen

所以,我发现了代码中的错误。

我删除了 syntax: true, 并在 quill 函数中添加了 $(document).ready(function () {});。现在可以使用了。