安装插件
npm install --save quill-blot-formatter
使用:
添加 ` :modules="modules"`
<template><QuillEditorref="refEditor"theme="snow":toolbar="toolbarOptions"contentType="html"enable:content="data.content":placeholder="data.placeholder":modules="modules"@update:content="onContentChange($event)" />
</template>
<script setup name="QEditor">import { ref, onMounted, reactive, watch } from 'vue'import { QuillEditor, Quill } from '@vueup/vue-quill'import '@vueup/vue-quill/dist/vue-quill.snow.css'import '../assets/css/quillEditor.css'import { AddQuillTitle } from '../assets/js/QuillToolsTitle'import BlotFormatter from 'quill-blot-formatter' /* 添加图片缩放插件 */const modules = ref({name: 'blotFormatter',module: BlotFormatter,options: {/* options */}})</script>
效果:
quill-blot-formatter