【版本】
vue-cli3
webpack@4.33.0
quill@1.3.6
【步骤】
npm install quill --save
在组件中引入Quill
editor.vue
import Quill from 'quill'
import 'quill/dist/quill.snow.css'
export default {
name: 'editor',
props: {
value: Object
},
data() {
return {
quill:null,
options: {
theme: 'snow',
modules: {
toolbar: [
['bold', 'italic', 'underline', 'strike'],
['blockquote', 'code-block'],
[{ 'header': 1 }, { 'header': 2 }],
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
[{ 'script': 'sub' }, { 'script': 'super' }],
[{ 'inde