国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Vue3中快速簡單使用CKEditor 5富文本編輯器

這篇具有很好參考價值的文章主要介紹了Vue3中快速簡單使用CKEditor 5富文本編輯器。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

Vue3中快速簡單使用CKEditor 5富文本編輯器,筆記,vue.js,ckeditor,ckeditor 5,plugin

前言

CKEditor 5就是內嵌在網(wǎng)頁中的一個富文本編輯器工具
CKEditor 5開發(fā)文檔(英文):https://ckeditor.com/docs/ckeditor5/latest/index.html

接下來帶你快速熟悉CKEditor 5在Vue3中簡單使用,看最終效果圖??Vue3中快速簡單使用CKEditor 5富文本編輯器,筆記,vue.js,ckeditor,ckeditor 5,plugin

準備

本文項目采用CKEditor 5定制經典配置(ckeditor5-build-classic) + @ckeditor/ckeditor5-vue

定制基礎配置

  1. 官網(wǎng)定制,選擇經典風格配置
    Vue3中快速簡單使用CKEditor 5富文本編輯器,筆記,vue.js,ckeditor,ckeditor 5,plugin
  2. 選擇富文本支持的功能插件,默認是這些,可進行增加刪除,增加點擊Add,刪除Remove即可
    Vue3中快速簡單使用CKEditor 5富文本編輯器,筆記,vue.js,ckeditor,ckeditor 5,plugin
  3. 可以拖動上面自己沒有的工具項目到下面自己的,也可以拖動下面工具來調整屬性可以刪除自己有的
    Vue3中快速簡單使用CKEditor 5富文本編輯器,筆記,vue.js,ckeditor,ckeditor 5,plugin
  4. 選擇默認編輯器語言,在此選擇中文
    Vue3中快速簡單使用CKEditor 5富文本編輯器,筆記,vue.js,ckeditor,ckeditor 5,plugin
  5. 然后點擊start開始構建配置好的富文本,并下載CKEditor 5 build
    Vue3中快速簡單使用CKEditor 5富文本編輯器,筆記,vue.js,ckeditor,ckeditor 5,plugin
  6. 將下載的富文本制定配置 解壓放入自己項目的根目錄下,名字改為ckeditor5-custom-build
    注意:什么名字都可以 只不過后面npm需要下載這個本地包要指定這個名字,后面會說到

富文本配置目錄

Vue3中快速簡單使用CKEditor 5富文本編輯器,筆記,vue.js,ckeditor,ckeditor 5,plugin

當前文章demo目錄結構

Vue3中快速簡單使用CKEditor 5富文本編輯器,筆記,vue.js,ckeditor,ckeditor 5,plugin

快速使用

  1. 在自己項目下package.json文件進行配置
    Vue3中快速簡單使用CKEditor 5富文本編輯器,筆記,vue.js,ckeditor,ckeditor 5,plugin
    key名字 是在自己項目中引入時用到,value中file: 告訴npm要下載本地包(本地包的名字是剛開始自定應的名字
    注意:配置完后執(zhí)行npm install安裝

  2. 在自己項目下執(zhí)行命令安裝@ckeditor/ckeditor5-vue
    npm install @ckeditor/ckeditor5-vue -S
    or
    pnpm add @ckeditor/ckeditor5-vue -S
    or
    year add @ckeditor/ckeditor5-vue -S
    Vue3中快速簡單使用CKEditor 5富文本編輯器,筆記,vue.js,ckeditor,ckeditor 5,plugin

  3. 做好以上準備后 在你需要用到富文本的組件中添加以下相關代碼即可

    <script setup>
    import { reactive } from "vue";
    import CKEditor from "@ckeditor/ckeditor5-vue";
    import ClassicEditor from "ckeditor5-build-classic";
    
    const state = reactive({
      editor: ClassicEditor,
      editorData: "<p>Content of the editor.</p>",
      editorConfig: {
        // The configuration of the editor.
      },
    });
    
    </script>
    
    <template>
      <main>
        <CKEditor.component
          :editor="state.editor"
          v-model="state.editorData"
          :config="state.editorConfig"
        ></CKEditor.component>
      </main>
    </template>
    
    <style scoped lang="scss">
    main {
      width: 800px;
      height: 600px;
      margin: 50px auto;
    }
    </style>
    <style lang="scss">
    .ck.ck-content {
      height: 400px;
    }
    </style>
    
  4. 如要繼續(xù)添加CKEditor 5富文本的功能性配置可以更改下載的ckeditor5-custom-build中的ckeditor.js
    Vue3中快速簡單使用CKEditor 5富文本編輯器,筆記,vue.js,ckeditor,ckeditor 5,plugin

    • 添加后在當前根目錄下npm run build 更新build文件
    • 然后在回到自己項目的根目錄下執(zhí)行npm uninstall ckeditor5-custom-build刪除重新安裝富文本本地npm包即可生效

demo

https://github.com/gitboyzcf/ckeditor-vue3-demo





到這里就結束了,后續(xù)還會更新 前端 系列相關,還請持續(xù)關注!
感謝閱讀,若有錯誤可以在下方評論區(qū)留言哦?。?!

Vue3中快速簡單使用CKEditor 5富文本編輯器,筆記,vue.js,ckeditor,ckeditor 5,plugin


推薦文章??
vue3 + ts以及ckEditor5 富文本編輯器 工具欄 以及正文內容的編輯問題小結!文章來源地址http://www.zghlxwxcb.cn/news/detail-702271.html

到了這里,關于Vue3中快速簡單使用CKEditor 5富文本編輯器的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。如若轉載,請注明出處: 如若內容造成侵權/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經查實,立即刪除!

領支付寶紅包贊助服務器費用

相關文章

  • Vue3 代碼塊高亮顯示并可使用富文本編輯器編輯(highlight.js + wangEditor)

    Vue3 代碼塊高亮顯示并可使用富文本編輯器編輯(highlight.js + wangEditor)

    在Vue項目中實現(xiàn)以下功能: ??功能1. 在頁面中顯示代碼,并將其中的高亮顯示。 ??功能2. 允許對代碼塊進行編輯,編輯時代碼也高亮顯示。 ??功能3. 可在編輯器中添加多個代碼塊,動態(tài)渲染代碼高亮。 ? Step1: 安裝所需插件(本文使用npm安裝,若需

    2023年04月21日
    瀏覽(66)
  • Web開發(fā)的富文本編輯器CKEditor介紹,Django有庫ckeditor_uploader對它進行支持

    Web開發(fā)的富文本編輯器CKEditor介紹,Django有庫ckeditor_uploader對它進行支持

    當需要在網(wǎng)頁應用程序中提供富文本編輯功能時,CKEditor是一個流行的選擇。CKEditor是一個開源的JavaScript富文本編輯器,它提供了強大的功能和用戶友好的界面,使用戶可以輕松創(chuàng)建和編輯格式化的文本內容。 以下是CKEditor的一些主要特性: 所見即所得編輯 :CKEditor提供了所

    2024年02月15日
    瀏覽(24)
  • vue3富文本編輯器vue-quill-editor、圖片縮放ImageResize詳細配置及使用教程

    vue3富文本編輯器vue-quill-editor、圖片縮放ImageResize詳細配置及使用教程

    官網(wǎng)地址:https://vueup.github.io/vue-quill/ 效果圖 ?1、安裝 2、在vue.config.js中添加配置,否則quill-image-resize-module會出現(xiàn)Cannot read property ‘imports‘ of undefined報錯問題 3、創(chuàng)建quillTool.js(用于添加超鏈接、視頻) 4、完整代碼

    2024年02月04日
    瀏覽(33)
  • 簡版的富文本編輯器、VUE+ElementUI 富文本編輯器 element ui富文本編輯器的使用(quill-editor) 不好用你來打我!全網(wǎng)醉簡單!要復雜的別來!

    簡版的富文本編輯器、VUE+ElementUI 富文本編輯器 element ui富文本編輯器的使用(quill-editor) 不好用你來打我!全網(wǎng)醉簡單!要復雜的別來!

    實現(xiàn)效果 ? 1.安裝插件 npm install vue-quill-editor --save 2.安裝成功后在package.json中查看 3.在main.js中全局引入插件 4.頁面實現(xiàn) 感謝老哥:?ElementUI生成富文本編輯器 https://blog.csdn.net/keplerm/article/details/123379511?spm=1001.2101.3001.6650.9utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCom

    2024年02月16日
    瀏覽(30)
  • Vue3 中vue-quill富文本編輯器圖片縮放

    Vue3 中vue-quill富文本編輯器圖片縮放

    ?導包 ? 添加配置? ?注: 該編輯器已經不在維護了,很古老了,打包后如果報錯,建議使用其他編輯器

    2024年04月25日
    瀏覽(101)
  • vue3富文本編輯器的二次封裝開發(fā)-Tinymce

    vue3富文本編輯器的二次封裝開發(fā)-Tinymce

    歡迎點擊領取 -《前端開發(fā)面試題進階秘籍》:前端登頂之巔-最全面的前端知識點梳理總結 專享鏈接 簡介 1、安裝:pnpm add tinymce @tinymce/tinymce-vue === Vue3 + tinymce + @tinymce/tinymce-vue 2、功能實現(xiàn)圖片上傳、基金卡片插入、收益卡片插入、源代碼復用、最大長度限制、自定義表情包

    2024年02月07日
    瀏覽(101)
  • dede ckeditor編輯器讓上傳圖片自動使用絕對地址顯示

    dedecms ckeditor編輯器讓上傳圖片自動使用絕對地址顯示,本教程適合織夢cms v57,其他版本未測試。由于我們網(wǎng)站為了更好更有效的解決seo方案,于是在考慮到發(fā)布文章的時候,上傳的正文圖片,是非絕對路徑的,于是我們把織夢cms默認編輯器ckeditor進行了小幅度的修改: 首先

    2024年02月16日
    瀏覽(19)
  • vue3+ts+tinynce富文本編輯器+htmlDocx+file-saver 配合實現(xiàn)word下載

    vue3+ts+tinynce富文本編輯器+htmlDocx+file-saver 配合實現(xiàn)word下載

    vue3 請下載html-docx-js-typescript,否則會報錯類型問題 row.report效果及數(shù)據(jù) 調用

    2024年02月11日
    瀏覽(24)
  • vue中使用wangeditor富文本編輯器

    vue中使用wangeditor富文本編輯器

    官方文檔? 項目中要求實現(xiàn)富文本編輯器取編輯內容 這種編輯器有好多選擇了wangeditor富文本編輯器 首先根據(jù)文檔安裝 再按照官方的指引 cv 如下代碼 這個時候編輯器的功能已經實現(xiàn)了 如下圖 ?但是目前為止他還不是我想要的 因為這個編輯器我想讓他在彈窗中出現(xiàn),而且我

    2023年04月26日
    瀏覽(29)
  • vue wangeditor 富文本編輯器的使用

    vue wangeditor 富文本編輯器的使用

    wangeditor 富文本編輯器,是實現(xiàn)類似CSDN文章編輯功能的插件(CSDN官方使用的是CKEditor 富文本編輯器)。 wangEditor官方文檔 根據(jù)自己項目使用的框架,采取不同的引入方式,如vue2: npm install @wangeditor/editor-for-vue --save 在vue2中使用wangeditor? (官方文檔配置) 上例配置的效果:

    2024年02月14日
    瀏覽(32)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領取紅包,優(yōu)惠每天領

二維碼1

領取紅包

二維碼2

領紅包