<template>
<div>
<QuillEditor ref="myQuillEditor" theme="snow" :content="modelValue" :options="data.editorOption" contentType="html" @update:content="setValue" />
<!-- 使用自定义图片上传 -->
<input type="file" hidden accept=".jpg,.png" ref="fileBtn" @change="handleUpload" />
</div>
</template>
下面为示例代码:
<script setup>
import { QuillEditor, Quill } from '@vueup/vue-quill'
import '@vueup/vue-quill/dist/vue-quill.snow.css'
import { ImageDrop } from 'quill-image-drop-module';
// import * as imageResize from 'quill-image-resize-module';
// import imageResize from 'quill-image-resize-module';
Quill.register('modules/ImageDrop', ImageDrop);
// Quill.register('modules/imageResize', imageResize);
// Quill.register('modules/imageResize', imageResize);
import { reactive, onMounted, ref, toRaw, watch } from 'vue'
import { client