我通过添加这个脚本来使用 ckeditor5。我想获取该值,但出现错误 Uncaught ReferenceError: ClassicEditor is not defined。这是我做的,不知道哪里错了,你能帮我吗?
<script src="{{ mix('dist/js/ckeditor-classic.js') }}"></script>
<script>
const editorElement = document.querySelector('.editor');
ClassicEditor
.create(document.querySelector('.editor'))
.then(editor => {
console.log(editor);
})
.catch(error => {
console.error(error);
});
function getDataFromDescriptionEditorEditor() {
return ClassicEditor.getData();
}
$(".btn-primary").on('click', function() {
console.log(getDataFromDescriptionEditorEditor());
})
</script>