<template>
    <div id="existingBasis"></div>
</template>

<script>
import E from 'wangeditor'
var phoneEditor, _this
export default {
  components: {},
  props: {
    existingBasisVal: {
      type: String,
      required: false
    }
  },
  data () {
    return {}
  },
  created () {},
  mounted () {
    _this = this
    phoneEditor = new E('existingBasis')
    phoneEditor.onchange = function () {
      _this.$emit('existingBasis', this.$txt.html())
    }

    phoneEditor.create()
    // phoneEditor.$txt.html(this.val)
  },
  methods: {},
  computed: {},
  watch: {
    existingBasisVal (val) {
      // console.log(val)
      phoneEditor.$txt.html(_this.existingBasisVal)
    }
  }
}
</script>

<style lang="scss" scoped>
#existingBasis {
  width: 100%;
  height: 250px;
}
</style>
