<template>
  <div v-loading="dataLoading">
    <ueditor
      :content.sync="content"
      :config="editorConfig"
      @loaded="dataLoading = false"
      @contentChange="contentChange">
    </ueditor>
  </div>
</template>
<script>
import ueditor from '@src/components/ueditor.vue'
export default {
  components: {
    ueditor: ueditor
  },

  props: {
    value: {
      type: String,
      required: true,
      default: ''
    },
    config: {
      type: Object,
      required: true,
      default: _ => ({})
    }
  },

  data() {
    return {
      editorConfig: {
        initialFrameHeight: 200
      },
      dataLoading: false
    }
  },

  computed: {
    content: {
      get() {
        return this.value
      },
      set(val) {
        this.$emit('update:value', val)
      }
    }
  },

  methods: {
    contentChange(val) {
      this.$emit('input', val)
    }
  }

}
</script>
<style scope>
</style>
