vue-quill-editor font
时间: 2023-11-24 19:37:31 浏览: 167
Vue-Quill-Editor is a rich text editor component for Vue.js that is based on Quill.js. To change the font in Vue-Quill-Editor, you can use the following steps:
1. Install Vue-Quill-Editor if you haven't already done so by running the following command:
```
npm install vue-quill-editor
```
2. Import Vue-Quill-Editor in your component:
```javascript
import { quillEditor } from 'vue-quill-editor'
```
3. In your template, use the `quillEditor` component and bind it to a data property representing the content:
```html
<template>
<div>
<quill-editor v-model="content" :options="editorOptions"></quill-editor>
</div>
</template>
```
4. In your component's data, define the `content` property and `editorOptions` object:
```javascript
export default {
data() {
return {
content: '',
editorOptions: {
// Quill.js configurations
}
}
}
}
```
5. To change the font, you can set the `editorOptions` object with the desired font family:
```javascript
export default {
data() {
return {
editorOptions: {
// Other Quill.js configurations
theme: 'snow',
modules: {
toolbar: [
// Toolbar options
]
},
fonts: ['Arial', 'Verdana', 'Helvetica']
}
}
}
}
```
By modifying the `fonts` property in the `editorOptions` object, you can specify the fonts available in the editor's font dropdown menu.
阅读全文