wangEditor for in vue

380 阅读1分钟
<template>
      <div ref="editor" style="text-align:left"></div>
  </div>
</template>

<script>
  import E from 'wangeditor'
  export default {
    name: 'editor',
    data() {
      return {
        editorContent: ''
      }
    },
    mounted() {
      let editor = new E(this.$refs.editor)
      editor.customConfig.zIndex=100
      editor.customConfig.onchange = (html) => {
        this.editorContent = html
      }
      editor.create()
    }
  }
</script>

<style lang="scss" scoped>

</style>