电脑端
1,组件
<Qedito
v-show="buttonType === 1"
v-model="details"
:value="details"
@quillContent="changeEditor" />
2.引入组件
import Qedito from '@/components/common/quill' //电脑端
import QeditoTwo from '@/components/common/quill2'//手机端
3.兼容电脑端组件
<template>
<div>
<quill-editor
ref="myQuillEditor"
v-model="content"
:options="editorOption"
@change="onEditorChange($event)"/>
<input id="selectPic" type="file" accept="image/jpeg,image/jpg,image/png" style="display: none" @change="onFileChange($event)">
</div>
</template>
<script>
const toolbarOptions = [
['bold', 'italic', 'underline', 'strike'], // toggled buttons
['blockquote', 'code-block'],
[{ 'header': 1 }, { 'header': 2 }], // custom button values
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
[{ 'script': 'sub' }, { 'script': 'super' }], // superscript/subscript
[{ 'indent': '-1' }, { 'indent': '+1' }], // outdent/indent
[{ 'direction': 'rtl' }], // text direction
[{ 'size': ['small', false, 'large', 'huge'] }], // custom dropdown
[{ 'header': [1, 2, 3, 4, 5, 6, false] }],
[{ 'color': [] }, { 'background': [] }], // dropdown with defaults from theme
[{ 'font': [] }],
[{ 'align': [] }],
['image']
]
import { quillEditor } from 'vue-quill-editor'
import { submitEditorPic } from '@/api/pic_manage'
export default{
comp