ckeditor5 - 未捕获的 ReferenceError:ExportWord 未定义 CkEditor5
问题描述
我正在尝试在我们的 MVC .NET Core 项目中实现 CkEditor5 的 ExportWord 功能。下面是我为实现它而编写的代码。但我收到错误 Uncaught ReferenceError: ExportWord is not defined。
<script src="https://cdn.ckeditor.com/ckeditor5/27.1.0/decoupled-document/ckeditor.js"></script>
<script>
import ExportWord from '@@ckeditor/ckeditor5-export-word/src/exportword';
DecoupledEditor
.create(document.querySelector('#editor'), {
cloudServices: {
tokenUrl:'https://79399.cke-cs.com/token/dev/d650c302199a11c66a2282a459be96af7c917d9be8b2956c0af4b580446f',
},
plugins: [ExportWord],
toolbar: {
items: [
'exportWord', '|',
'heading', '|',
'alignment', '|',
'bold', 'italic', 'strikethrough', 'underline', 'subscript', 'superscript', '|',
'link', '|',
'bulletedList', 'numberedList', 'todoList',
'fontfamily', 'fontsize', 'fontColor', 'fontBackgroundColor', '|',
'code', 'codeBlock', '|',
'insertTable', '|',
'outdent', 'indent', '|',
'uploadImage', 'blockQuote', '|',
'undo', 'redo'
],
exportWord: {
stylesheets: ['EDITOR_STYLES'],
fileName: 'file.docx',
converterOptions: {
converterUrl: 'https://docx-converter.cke-cs.com/v1/convert',
format: 'A4',
margin_top: '20mm',
margin_bottom: '20mm',
margin_right: '12mm',
margin_left: '12mm'
}
},
shouldNotGroupWhenFull: true
},
})
.then(editor => {
const toolbarContainer = document.querySelector('#toolbar-container');
toolbarContainer.appendChild(editor.ui.view.toolbar.element);
})
.catch(error => {
console.error(error);
});
我该如何实施?
解决方案
推荐阅读
- jquery - 升级 jQuery 数据表后,引导工具提示无法正常工作
- java - 顶级命令 - java 进程中的线程名称
- python - 几个小时后,scraper 在服务器上自动被杀死,而其他蜘蛛继续在同一台服务器上运行
- perl - perl中如何将列转换为行
- javascript - 如何对具有多个参数的对象数组进行数字排序
- python-3.x - docplex 的文档和语法参考
- reactjs - 如何使用 React 连接到 Laravel Websocket?
- autodesk-forge - externalId Navisworks 文件的持久性
- node.js - ES6类中的Nodejs Websocket连接
- javascript - Google Maps DirectionService.Route 批处理请求