wangting
2024-04-26 c4d9e7a20dac267c5496ad3586c5053be279a17a
Source/ProjectWeb/src/components/PLT-basic-component/richText.vue
@@ -1,5 +1,5 @@
<template>
  <div id='quillEditorQiniu'>
  <div id='quillEditorQiniu' v-if="display">
    <!-- 基于elementUi的上传组件 el-upload begin-->
    <el-upload
      :accept="'image'"
@@ -12,9 +12,13 @@
      class="avatar-uploader">
    </el-upload>
    <!-- 基于elementUi的上传组件 el-upload end-->
    <quill-editor ref="customQuillEditor" v-model="content" :options="editorOption" class="editor">
    <quill-editor ref="customQuillEditor" v-model="value" :disabled="disabled" :options="editorOption" class="editor">
    </quill-editor>
  </div>
  <!--    <template #footer>-->
  <!--      <el-button size="small">确定</el-button>-->
  <!--      <el-button size="small" @click="dialogVisible = false">关闭</el-button>-->
  <!--    </template>-->
</template>
<script>
@@ -36,6 +40,24 @@
  ['clean']                                     // 清除文本格式
];
export default {
  name: 'richText',
  props: {
    visible: {
      type: Boolean,
      default: false,
    },
    value: {
      type: String
    },
    disabled:{
      type:Boolean,
      default:false
    },
    display:{
      type:Boolean,
      default:true
    }
  },
  data() {
    return {
      headers: {
@@ -65,6 +87,7 @@
      },
    }
  },
  computed: {},
  methods: {
    //上传图片之前async
    beforeEditorUpload(file) {
@@ -126,13 +149,7 @@
    console.log("开始加载")
    // 初始给编辑器设置title
  },
  watch: {
    content(newVal, oldVal) {
      //this.$emit('input', newVal);
      console.log(newVal)
      console.log(oldVal)
    }
  },
  watch: {},
}