Mak*_*sov 17
这是关于此https://github.com/ckeditor/ckeditor5-angular/issues/134的问题。您需要创建自定义 CKEditor 构建并在其中包含必要的插件。这是指南:https: //ckeditor.com/docs/ckeditor5/latest/builds/guides/development/custom-builds.html 顺便说一句,我建议您使用最新版本的 CKEditor 5。
更新:
git clone https://github.com/ckeditor/ckeditor5-build-classic.git
npm install
npm install --save @wiris/mathtype-ckeditor5
src/ckeditor.js编辑器的新插件:...
import MathType from '@wiris/mathtype-ckeditor5';
...
ClassicEditor.builtinPlugins = [
...
MathType
];
ClassicEditor.defaultConfig = {
toolbar: {
items: [
...
'MathType',
...
]
},
...
};
Run Code Online (Sandbox Code Playgroud)
yarn run build
build文件夹中的所有内容复制到您的项目中。例如src/assets/js/ck-editor-math-type/
-> translations
-> ...
-> ckeditor.js
Run Code Online (Sandbox Code Playgroud)
package.json"dependencies": {
...
"@ckeditor/ckeditor5-angular": "^1.1.2",
...
}
Run Code Online (Sandbox Code Playgroud)
import * as ClassicEditor from '../../assets/js/ck-editor-math-type/ckeditor.js';
...
export class CkeditComponent implements OnInit {
public Editor = ClassicEditor;
public model = {
editorData: '<p>Hello, world!</p>'
};
}
Run Code Online (Sandbox Code Playgroud)
<ckeditor [(ngModel)]="model.editorData" [editor]="Editor"></ckeditor>
Run Code Online (Sandbox Code Playgroud)
希望这对你有帮助。
| 归档时间: |
|
| 查看次数: |
6762 次 |
| 最近记录: |