使用CKeditor v5联机构建器下载默认设置。
当你使用它的时候,一切都很有效。但是当使用要加载本地(以及下载的在线构建器版本)时,所有的按钮都消失了,为什么?
我们很感激你的帮助。
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<script src="/ckeditor5/build/ckeditor.js"></script>
<!-- <script src="https://cdn.ckeditor.com/ckeditor5/20.0.0/classic/ckeditor.js"></script> -->
<body>
<div id="editor">Test Text (buttons missing)</div>
<script>
ClassicEditor
.create( document.querySelector( '#editor' ) )
.catch( error => {
console.error( error );
} );
</script>
</body>
</html>发布于 2020-07-02 19:38:30
检查附加到CKEditor 5构建的示例的源代码( sample /index.html)。您将注意到,在初始化CKEditor实例时需要传递工具栏配置。
发布于 2020-08-26 10:37:34
对于有角度的用户:
尽管默认的ckeditor (@ckeditor/ckeditor5-build-classic/build/ckeditor)带来了它自己的工具栏按钮,但您必须自己为自定义构建添加它(例如,https://ckeditor.com/ckeditor-5/online-builder/)
将从theCustomBuild/sample/index.html生成的工具栏数组复制到您的配置中:
html:
<ckeditor [editor]="Editor" [config]="config"></ckeditor>在你的组成部分中:
public config = {
toolbar: [
'exportPdf',
'heading',
'|',
'bold',
...
]
};https://stackoverflow.com/questions/62695657
复制相似问题