我正严格按照他们在https://ckeditor.com/docs/ckeditor5/latest/builds/guides/quick-start.html的官方文档,尝试在我的代码中包括CKEditor5。是的,它已经显示出来了,但是UI似乎不起作用。我无法将文字加粗,例如...
有人有什么主意吗?
<script src="{{ asset('js/app.js') }}" defer></script>
<script src="https://cdn.ckeditor.com/ckeditor5/12.2.0/classic/ckeditor.js"></script>
...
<form method="POST" action="{{ route('posts.store') }}" enctype="multipart/form-data">
@csrf
<div class="form-group">
<label for="title">Title</label>
<input type="text" name="title" id="title" class="form-control" placeholder="Enter post title" />
</div>
<div class="form-group">
<label for="slug">Post slug</label>
<input type="text" name="slug" id="slug" class="form-control" placeholder="Enter post slug" />
</div>
<div class="form-group">
<label for="body">Content</label>
<textarea name="body" id="editor"></textarea>
</div>
<div class="custom-file">
<input type="file" name="cover_image" id="cover_image" class="custom-file-input" />
<label class="custom-file-label" for="cover_image">Choose cover image (optional)</label>
</div>
<hr />
<button type="submit" class="btn btn-primary">Submit</button>
</form>
...
<script>
ClassicEditor
.create( document.querySelector( '#editor' ) )
.catch( error => {
console.error( error );
} );
</script>