兰宝车间质量管理系统-前端
疯狂的狮子Li
2023-04-03 1595cb282aab5399862fac6406b5de550863e3b6
src/components/Editor/index.vue
@@ -1,3 +1,31 @@
<template>
  <div>
    <el-upload
      :action="upload.url"
      :before-upload="handleBeforeUpload"
      :on-success="handleUploadSuccess"
      :on-error="handleUploadError"
      class="editor-img-uploader"
      name="file"
      :show-file-list="false"
      :headers="upload.headers"
      style="display: none"
      v-if="type === 'url'"
    >
    </el-upload>
    <div class="editor">
      <quill-editor
        ref="myQuillEditor"
        v-model:content="content"
        contentType="html"
        @textChange="(e: any) => $emit('update:modelValue', content)"
        :options="options"
        :style="styles"
      />
    </div>
  </div>
</template>
<script setup lang="ts">
import { QuillEditor, Quill } from '@vueup/vue-quill';
import '@vueup/vue-quill/dist/vue-quill.snow.css';
@@ -136,34 +164,6 @@
  proxy?.$modal.msgError('上传文件失败');
}
</script>
<template>
   <div>
      <el-upload
         :action="upload.url"
         :before-upload="handleBeforeUpload"
         :on-success="handleUploadSuccess"
         :on-error="handleUploadError"
         class="editor-img-uploader"
         name="file"
         :show-file-list="false"
         :headers="upload.headers"
         style="display: none"
         v-if="type === 'url'"
      >
      </el-upload>
      <div class="editor">
         <quill-editor
            ref="myQuillEditor"
            v-model:content="content"
            contentType="html"
            @textChange="(e: any) => $emit('update:modelValue', content)"
            :options="options"
            :style="styles"
         />
      </div>
   </div>
</template>
<style>
.editor, .ql-toolbar {