CKEditor簡介
CKEditor是新一代的FCKeditor,是一個重新開發的版本。CKEditor是全球最優秀的網頁在線文字編輯器之一,因其驚人的性能與可擴展性而廣泛的被運用於各大網站。
可配合使用的擴展有 文件管理器KCFinder
KCFinder 文件管理器
KCFinder 跟 CKFinder 類似,是 CKEditor 的一個開源文件管理器插件,通過該插件可上傳和對包括圖片、Flash動畫以及其他文件進行你個瀏覽和管理。
CKEditor 的使用
1. CKEditor 官網下載js插件
進入官網https://ckeditor.com/ckeditor-5/download/
由上圖所示,官方提供了3中下載方式:
- nam 下載:
npm install --save @ckeditor/ckeditor5-build-classic
- Zip打包下載
- 直接點擊 Download 難下載
- CDN在線引用
備註:目前最新版本v11.2.0
2. CKEditor 安裝使用
引入CKEditor的js文件
頁面中使用CKEditor
描述:
ClassicEditor
.create( document.querySelector( '#editor' ), {
// toolbar: [ 'heading', '|', 'bold', 'italic', 'link' ]
} )
.then( editor => {
window.editor = editor;
} )
.catch( err => {
console.error( err.stack );
} );
HTML具體示例:
The three greatest things you learn from traveling
Like all the great things on earth traveling teaches us by example. Here are some of the most precious lessons I’ve learned over the years of traveling.
Appreciation of diversity
Getting used to an entirely different culture can be challenging. While it’s also nice to learn about cultures online or from books, nothing comes close to experiencing in person. You learn to appreciate each and every single one of the differences while you become more culturally fluid.
Confidence
Going to a new place can be quite terrifying. While change and uncertainty makes us scared, traveling teaches us how ridiculous it is to be afraid of something before it happens. The moment you face your fear and see there was nothing to be afraid of, is the moment you discover bliss.
ClassicEditor
.create( document.querySelector( '#editor' ), {
// toolbar: [ 'heading', '|', 'bold', 'italic', 'link' ]
} )
.then( editor => {
window.editor = editor;
} )
.catch( err => {
console.error( err.stack );
} );
展示效果
CKEditor 特點
- 高擴展性和可用性
- 新的數據模型
- ES6支持
貢獻者
- IT實戰聯盟-Line https://www.jianshu.com/u/283f93ada597
- 更多精彩內容可以關注“IT實戰聯盟”公眾號哦~~~
閱讀更多 IT實戰聯盟 的文章