quill-editor 字体显示样式
时间: 2023-10-29 21:06:41 浏览: 129
对于 quill-editor 的字体显示样式,可以通过以下几种方式进行设置:
1. 在 CSS 样式文件中定义样式,例如:
```
.ql-editor {
font-family: 'Microsoft YaHei', Arial, sans-serif;
font-size: 16px;
}
```
2. 在初始化 quill 实例时,通过 options 对象的属性进行设置,例如:
```
var quill = new Quill('#editor', {
modules: {
toolbar: '#toolbar'
},
placeholder: 'Compose an epic...',
theme: 'snow',
// 设置字体样式
formats: ['font', 'size'],
// 设置字体家族
font: ['Microsoft YaHei', 'Arial', 'sans-serif'],
// 设置字体大小
size: [10, 12, 14, 16, 18, 20]
});
```
3. 在 quill-editor 中使用自定义主题,并在 CSS 样式文件中定义样式,例如:
```
.ql-custom .ql-editor {
font-family: 'Microsoft YaHei', Arial, sans-serif;
font-size: 16px;
}
```
阅读全文
相关推荐


















