//1. 从第三个开始删除,删除4个
// console.log(this.quill.deleteText(2, 4)); // 12345678 1278
// 2.(返回对象)返回从第三个开始,返回4个,编辑器里面不变 .insert = 3456; 不写参数参数,默认全部
// console.log(this.quill.getContents(2, 4)); // 12345678 3456
//3.检索编辑器内容的长度 返回值是要加一
// console.log(this.quill.getLength(3)); // 12345678 9
//4.同quill.getContents(2, 4);返回值不一样,
// console.log(this.quill.getText(2, 4)); // 12345678 3456 //5.编辑器里值不会被覆盖 编辑器里插入值 (位置,类型,内容)
// console.log(this.quill.insertEmbed(10, 'image', 'https://quilljs.com/images/cloud.png'));
//6.编辑器里值不会被覆盖 编辑器里插入值(文本) (位置,内容,  格式)
// console.log(this.quill.insertText(0, 'Hello', 'bold', true));
// console.log(this.quill.insertText(5, 'Quill', {
// 'color': 'red',
// 'italic': true
// }));
//7.编辑器里值被覆盖 编辑器里插入值(文本) (位置,内容,  格式) 以{ insert: '\n' }结尾
// console.log(this.quill.setContents([
// { insert: 'Hello ' },
// { insert: 'World!', attributes: { bold: true } },
// { insert: '\n' }
// ]));
//8.编辑器里值被覆盖
// console.log(this.quill.setText('Hello\n'));
//9.没研究,会报错 home.vue?250d:109 Uncaught ReferenceError: Delta is not defined
// console.log(this.quill.updateContents(new Delta()
// .retain(6) // Keep 'Hello '
// .delete(5) // 'World' is deleted
// .insert('Quill')
// .retain(1, { bold: true }) // Apply bold to exclamation mark
// )); //10.设置编辑器里内容格式format
// this.quill.format('color', 'red');
// this.quill.format('align', 'right');
// this.quill.setText('Hello\nWorld!\n');
//11.formatLine
//formatLine(index: Number, length: Number, source: String = 'api'): Delta
// formatLine(index: Number, length: Number, format: String, value: any,
// source: String = 'api'): Delta
// formatLine(index: Number, length: Number, formats: { [String]: any },
// source: String = 'api'): Delta
// this.quill.formatLine(0, 2, 'align', 'right'); // right aligns the first line
// this.quill.formatLine(4, 4, 'align', 'center'); // center aligns both lines
// 12.formatText
// this.quill.setText('Hello\nWorld!\n'); // this.quill.formatText(0, 5, 'bold', true); // bolds 'hello' // this.quill.formatText(0, 5, { // unbolds 'hello' and set its color to blue
// 'bold': false,
// 'color': 'rgb(0, 0, 255)'
// }); // this.quill.formatText(5, 1, 'align', 'right'); // right aligns the 'hello' line
// 13 getFormat 获取格式
// this.quill.setText('Hello World!');
// this.quill.formatText(0, 2, 'bold', true);
// this.quill.formatText(1, 2, 'italic', true);
// this.quill.getFormat(0, 2); // { bold: true }
// this.quill.getFormat(1, 1); // { bold: true, italic: true }
// 14. 移除格式 removeFormat
// this.quill.setContents([
// { insert: 'Hello', { bold: true } },
// { insert: '\n', { align: 'center' } },
// { insert: { formula: 'x^2' } },
// { insert: '\n', { align: 'center' } },
// { insert: 'World', { italic: true }},
// { insert: '\n', { align: 'center' } }
// ]);
// this.quill.removeFormat(3, 7); // 15.getBounds 获取区域
// getBounds(index: Number, length: Number = 0):
// 返回值 { left: Number, top: Number, height: Number, width: Number }
// this.quill.setText('Hello\nWorld\n');
// console.log(this.quill.getBounds(0, 2)); // Returns { height: 15, width: 0, left: 27, top: 31 }
// 16.获取鼠标的位置 getSelection
// var range = this.quill.getSelection();
// if (range) {
// console.log(range)
// if (range.length == 0) {
// console.log('User cursor is at index', range.index);
// } else {
// var text = this.quill.getText(range.index, range.length);
// console.log(this.quill.getLength());
// console.log('User has highlighted: ', text);
// }
// } else {
// console.log('User cursor is not in editor');
// }
// 17
this.quill.on('text-change', function(delta, oldDelta, source) {
if (source == 'api') {
console.log("An API call triggered this change.");
} else if (source == 'user') {
console.log("A user action triggered this change.");
}
});

quill富文本编辑器 API的更多相关文章

  1. Quill 富文本编辑器

    Quill 富文本编辑器 https://quilljs.com/ https://github.com/quilljs/quill https://github.com/quilljs/awesom ...

  2. Vue整合Quill富文本编辑器

    Quill介绍 Quill是一款开源的富文本编辑器,基于可扩展的架构设计,提供丰富的 API 进行定制.截止2021年1月,在github上面已有28.8k的star. Quill项目地址:https ...

  3. 轻量级quill富文本编辑器

    因为公司产品需要在移动端编辑文本,所以发现了这个轻量级的好东西,网上也没找到比较好的案例,就自己总结了下,有兴趣的直接复制代码运行看看就知道啦! 下面是quill.js的CDN加速地址: <!- ...

  4. Vue2 封装的 Quill 富文本编辑器组件 Vue-Quill-Editor

    1.安装 npm install vue-quill-editor --save 2.使用 import { quillEditor } from 'vue-quill-editor' 3.组件中 & ...

  5. react-quill 富文本编辑器

    适合react的一款轻量级富文本编辑器 1.http://blog.csdn.net/xiaoxiao23333/article/details/62055128 (推荐一款Markdown富文本编辑 ...

  6. quilljs 一款简单轻量的富文本编辑器(适合移动端)

    quilljs入门使用教程: quill.js是一款强大的现代富文本编辑器插件.该富文本编辑器插件支持所有的现代浏览器.平板电脑和手机.它提供了文本编辑器的所有功能,并为开发者提供大量的配置参数和方法 ...

  7. angular4 富文本编辑器

    使用quill富文本编辑器实现,angular项目中用到了ngx-quill插件. quill的GitHub地址:https://github.com/quilljs/quill ngx-quill的 ...

  8. vue-quill-editor 富文本编辑器插件介绍

    Iblog项目中博文的文本编辑器采用了vue-quill-editor插件,本文将简单介绍其使用方法. 引入配置 安装模块 npm install vue-quill-editor --save in ...

  9. Quill – 可以灵活自定义的开源的富文本编辑器

    Quill 的建立是为了解决现有的所见即所得(WYSIWYG)的编辑器本身就是所见即所得(指不能再扩张)的问题.如果编辑器不正是你想要的方式,这是很难或不可能对其进行自定义以满足您的需求. Quill ...

随机推荐

  1. python学习-01

    1.编程语言分类: 编译型:(由编译器将代码编译成计算机识别的二进制文件)C \C++ \C#    运行速度较解释型语言快 解释型:(在运行时进行编译)python.php.sheel.ruby.j ...

  2. ide phpStorm常用代码片段设置

    1.打开设置(File -> Settings) 2.如图 3 . 最后,在PHP文件中输入 ll 并按 TAB 即可打出代码块

  3. RuntimeError: implement_array_function method already has a docstring

    根源:Numpy/Scipy/Pandas/Matplotlib/Scikit-learn 出现冲突 解决办法: pip uninstall scikit-learn pip uninstall ma ...

  4. python中字符串的拼接

    1.+ 号 2.format() 3.f"{username}登录成功" 4.%s 5.列表中的 join 6.逗号 http://www.cnblogs.com/gengcx/p ...

  5. win7下编译Microsoft版的caffe包的MATLAB接口(CPU模式)

    本博客是基于http://www.cnblogs.com/njust-ycc/p/5776286.html这篇博客修改的,做出了更正与补充. 本人机器的环境:Win7+MATLAB2014b+VS20 ...

  6. MySQL主从复制延迟的问题 #M1002#

    MySQL主从复制延迟的问题 #M1002# https://mp.weixin.qq.com/s/NwFGER-qn2xQ5TnG-php1Q 更为糟糕的是,MySQL主从复制在大事务下的延迟.同样 ...

  7. 解决python tkinter 与 sleep 延迟问题

    多线程(threading——join) join ()方法:主线程A中,创建了子线程B,并且在主线程A中调用了B.join(),那么,主线程A会在调用的地方等待,直到子线程B完成操作后, 才可以接着 ...

  8. H3C交换机引发的奇葩故障

    设备:H3C S5120-28P-SI 故障:某个交换机的接口速率只有100Mbps. 描述:这个故障还是很特别的,因为按普通的测试办法很难第一时间判断是交换机的固件问题,我也是做了几乎所有外围设备和 ...

  9. linux文件与目录的创建

    在Linux初期的学习中,是我们对基础命令的掌握,首先我们学习文件与目录的创建,分别有一些命令与选项,我们依次来看: 1:在Linux系统中,一切服务皆以文件的形式表现,脚本文件,服务配置文件,记事本 ...

  10. Aliyun OSS Nginx proxy module(阿里云OSS Nginx 签名代理模块)

    1.此文章主要介绍内容 本文主要介绍如何利用Nginx lua 实现将阿里云OSS存储空间做到同本地磁盘一样使用.核心是利用Nginx lua 对OSS请求进行签名并利用内部跳转将所有访问本地Ngin ...