如果我需要使用ngx-quill,我只需要知道如何完成此操作。
我知道您可以使用[自定义]选项来完成此操作。我看到了那个。但是我不了解如何实施。
如果目标是在编辑器中显示
表,那么一个好的解决方案可以在仅读取模式下呈现第二个编辑器:
<!-- editor -->
<p-editor
(onInit)="onSourceInit($event.editor)"
(onTextChange)="onSourceChange()" />
<!-- preview -->
<p-editor
styleClass="readonly"
[readonly]="true"
(onInit)="onDestinationInit($event.editor)" />
代码范围需要同步两个编辑器。最好通过使用内部羽毛表(Deltas)来实现这一点:
一些样式,因此看起来无缝:
:host ::ng-deep {
.p-editor-container.readonly {
// hiding the toolbar in the readonly mode
.p-editor-toolbar { display: none; }
// hiding the content border in the readonly mode
.p-editor-content { border: none; }
}
// making some room for the editors
.p-editor-content { height: 300px; }
}