1.安装依赖
"@ckeditor/ckeditor5-build-balloon": "^10.1.0",
"@ckeditor/ckeditor5-build-classic": "^10.1.0",
"@ckeditor/ckeditor5-build-inline": "^10.1.0",
"vue-ckeditor5": "^0.1.5",

 2.html 

 <div id="ckEditor">
<vue-ckeditor type="balloon" v-model="content" :editors="editors1" :config='config' ></vue-ckeditor>
</div>

3.引入文件

  import ClassicEditor from '@ckeditor/ckeditor5-build-classic'
import BalloonEditor from '@ckeditor/ckeditor5-build-balloon'
import InlineEditor from '@ckeditor/ckeditor5-build-inline'
import VueCkeditor from 'vue-ckeditor5'

4.js

    data(){
return {
content: '',
editors1: {
// classic: ClassicEditor,
balloon: BalloonEditor
},
config:{
language:'en',
ckfinder: {
uploadUrl: $.getCookie('prefixUrl') +'/file/uploads'
},
image:{
toolbar: [ 'imageTextAlternative', '|', 'imageStyle:alignLeft', 'imageStyle:full', 'imageStyle:alignRight' ],
styles: [
// This option is equal to a situation where no style is applied.
'full',
// This represents an image aligned to the left.
'alignLeft',
// This represents an image aligned to the right.
'alignRight'
]
},
fontSize: {
options: [
'tiny',
'small',
'big',
'huge'
]
},
fontFamily: {
options: [
'default',
'Ubuntu, Arial, sans-serif',
'Ubuntu Mono, Courier New, Courier, monospace'
]
},
toolbar: [
'heading',
'|',
'alignment',// <--- ADDED
'bold',
'italic',
'link',
'fontFamily',
'fontSize',
// 'bulletedList',
// 'numberedList',
'imageUpload',
// 'blockQuote',
'undo',
'redo'
]
}
}
},
    components:{
      'vue-ckeditor': VueCkeditor.component
    }
 

5.处理数据

      ctbrife(str){
// str = str.replace(/\<c:if\b[^>]*>([\s\S]*?)</c:if>/g,'')
str = str.replace(/<\/?[^>]*>/g,''); //去除HTML tag
str = str.replace(/[ | ]*\n/g,'\n'); //去除行尾空白
//str = str.replace(/\n[\s| | ]*\r/g,'\n'); //去除多余空行
str=str.replace(/ /ig,'');//去掉 
return str.substring(0,40);
}

vue+ckEditor5的更多相关文章

  1. ckeditor5富文本编辑器在vue中的使用

    安装依赖: npm install --save @ckeditor/ckeditor5-vue @ckeditor/ckeditor5-build-classic 要创建编辑器实例,必须首先将编辑器 ...

  2. CKEditor5 + vue2.0 自定义图片上传、highlight、字体等用法

    因业务需求,要在 vue2.0 的项目里使用富文本编辑器,经过调研多个编辑器,CKEditor5 支持 vue,遂采用.因 CKEditor5 文档比较少,此处记录下引用和一些基本用法. CKEdit ...

  3. CKEditor5 输入文字时拼音和汉字同时输入问题

    在使用 CKEditor5 + vue 时,出现输入文字时,拼音和文字一起输入到编辑器到问题.与之前项目中使用 ckeditor 的区别是,这次项目是在 python 架构下局部引入 ckeditor ...

  4. vue集成ckeditor富文本框,怎么获取CKEditor实例?

    CKEDITOR 版本5 ,vue集成形式 vue集成ckeditor富文本框,由于不是通过js创建的富文本对象,所以,无法取得实例对象,官方说明 官方在builds-->Getting and ...

  5. vue集成CKEditor构建框架的使用,遇到富文本框不出现工具栏等操作

    官方关于Vue集成CKEditor富文本框的文档:https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/framew ...

  6. Vue.js 和 MVVM 小细节

    MVVM 是Model-View-ViewModel 的缩写,它是一种基于前端开发的架构模式,其核心是提供对View 和 ViewModel 的双向数据绑定,这使得ViewModel 的状态改变可以自 ...

  7. wepack+sass+vue 入门教程(三)

    十一.安装sass文件转换为css需要的相关依赖包 npm install --save-dev sass-loader style-loader css-loader loader的作用是辅助web ...

  8. wepack+sass+vue 入门教程(二)

    六.新建webpack配置文件 webpack.config.js 文件整体框架内容如下,后续会详细说明每个配置项的配置 webpack.config.js直接放在项目demo目录下 module.e ...

  9. wepack+sass+vue 入门教程(一)

    一.安装node.js node.js是基础,必须先安装.而且最新版的node.js,已经集成了npm. 下载地址 node安装,一路按默认即可. 二.全局安装webpack npm install ...

随机推荐

  1. 小D课堂-SpringBoot 2.x微信支付在线教育网站项目实战_4-1.单机和分布式应用的登录检验讲解

    笔记 第四章 开发在线教育视频站点核心业务之JWT微服务下的用户登录权限校验 1.单机和分布式应用的登录检验讲解     简介:讲解单机和分布式应用下登录校验,session共享,分布式缓存使用 1. ...

  2. java序列化与反序列化操作redis

     笔者在使用SSM框架项目部分功能进行测试需要使用到对象的序列化与反序列化 第一种方式:jackson Demo package com.dznfit.service; import com.dznf ...

  3. React Native使用Redux总结

    1>npm安装redux: "react-redux": "^5.0.5", "redux": "^3.7.1", ...

  4. Python multiprocess模块(上)

    multiprocess模块 一. Process模块介绍 1. 直接使用Process模块创建进程 (1)主进程和子进程 (2)if __name__ == "__main__" ...

  5. idea 中的new file 没有jsp

    idea 的new file中没有你需要的文件,原因是IDEA认为当前包下不应该创建该文件,以就没有创建该文件的选项. 以jsp 文件为例.其他文件类似. 解决方法: File ---> pro ...

  6. 一些php常用函数积累

    本文链接 <?php // id: ecffe70d3af54df9bad97b61918ace7d global $ct_path, $ct_log_path; $log_path = &qu ...

  7. 配置glance使用ceph作为后端存储

    在ceph监视器上执行 1.创建pool池 为glance服务创建pool池(因为我只有一个OSD节点,所以要将副本数设置为1) ceph osd pool create glance-images  ...

  8. day16 模块导入及环境变量

    """ 今日内容: 1.模块 2.模块的导入 3.环境变量sys.path 4.模块间的相互调用 """ """ ...

  9. Redis二进制反转算法分析

    在 redis 源码中 dictScan 算法中用到了用到了非常经典的二进制反转算法,该算法对二进制的反转高效而实用,同时对于理解位运算也有非常大的帮助.先呈现源码: /* Function to r ...

  10. 2019牛客暑期多校训练营(第七场)-B Irreducible Polynomial(多项式因式分解)

    题目链接:https://ac.nowcoder.com/acm/contest/887/B 题意:给定整系数多项数,判断实数域上是否可约. 思路: AC代码: #include<cstdio& ...