vue-quill-editor 的使用

import Vue from 'vue'
import vueQuillEditor from 'vue-quill-editor'
import vueCodeMirror from 'vue-codemirror-lite'
import App from './App.vue'
import router from './router'

import '@/assets/css/common.css'
import '@/assets/css/animate.css'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'

Vue.config.productionTip = false
Vue.use(vueQuillEditor)
Vue.use(vueCodeMirror)

new Vue({
  router,
  render: h => h(App),
}).$mount('#app')

 

方式一:

name: 'editor',
data(){
	return {
		content: `

hello world

`, editorOption: { theme:'snow', modules: { toolbar: '#toolbar' } } } }

 

方式二:

name: 'editor',
data(){
	return {
		content: `

hello world

`, editorOption: { theme:'snow', modules: { toolbar: [ ['bold', 'italic', 'underline', 'strike'], ['blockquote', 'code-block'], [{ 'header': 1 }, { 'header': 2 }], [{ 'list': 'ordered' }, { 'list': 'bullet' }], [{ 'script': 'sub' }, { 'script': 'super' }], [{ 'indent': '-1' }, { 'indent': '+1' }], [{ 'direction': 'rtl' }], [{ 'size': ['small', false, 'large', 'huge'] }], [{ 'header': [1, 2, 3, 4, 5, 6, false] }], [{ 'font': [] }], [{ 'color': [] }, { 'background': [] }], [{ 'align': [] }], ['clean'], ['link', 'image', 'video'] ] } } } }

 

 

相关阅读:

https://github.com/surmon-china/vue-quill-editor

你可能感兴趣的:(vue)