CKFinder问题未捕获的TypeError:无法使用CKEditor 5读取未定义的属性“模态”-Vue js

时间:2019-04-15 12:42:22

标签: javascript vue.js ckeditor ckfinder ckeditor5

我正在尝试将CKFinder集成到Vue js应用程序中。但是面对此问题未捕获的TypeError:无法读取未定义的属性'modal'

我正在跟踪official documentation for CKEditor5 / CKFinder for Vue js。

这是ckfinder的配置。

    ckfinder: {
        // Define the CKFinder configuration (if necessary).
        options: {
            resourceType: 'Images'
        },
    }

这是浏览器控制台中显示的完整错误消息。

Uncaught TypeError: Cannot read property 'modal' of undefined
    at CKFinderCommand.execute (ckfindercommand.js?9ed3:153)
    at CKFinderCommand.eval (observablemixin.js?3466:268)
    at CKFinderCommand.fire (emittermixin.js?e4c7:236)
    at CKFinderCommand.(:9191/anonymous function) [as execute] (webpack-internal:///./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js:296:19)
    at CommandCollection.execute (commandcollection.js?e961:92)
    at ClassicEditor.execute (editor.js?7e01:299)
    at ButtonView.eval (ckfinderui.js?8a75:47)
    at ButtonView.fire (emittermixin.js?e4c7:236)
    at TemplateToBinding.eval (buttonview.js?d175:167)
    at ProxyEmitter.callback (template.js?56c1:1208)

1 个答案:

答案 0 :(得分:0)

您需要先将CKFinder附加到页面上,以便CKEditor 5可以使用它。

最简单的方法是使用脚本标签:

<script src="https://example.com/ckfinder/ckfinder.js"></script>

更多信息:https://ckeditor.com/docs/ckeditor5/latest/features/image-upload/ckfinder.html#configuring-the-full-integration