<template>
  <div  class="box-center">
    <div class="edit_container" style="margin-top:50px;">
      <div id="editor"></div>
    </div>
    <div style="margin-top: 10px">
      <el-button @click="upload">确定</el-button>
    </div>
  </div>
</template>

<script>
import E from "wangeditor";
export default {
  data() {
    return {
      content: ``,
      editor:null,
    };
  },

  mounted() {
    const editor = new E("#editor");
    // 设置编辑区域高度为 500px
    editor.config.height = 500;
    editor.config.placeholder = "placeholder";
    // 配置 server 接口地址
    // editor.config.uploadImgServer = "/upload-img";
    editor.config.uploadImgShowBase64 = true
    editor.config.zIndex = 500
    editor.create();
    this.editor=editor
  },
  methods: {
    upload(){
      let str=this.editor.txt.html()
      console.log(str);
    }
  },
};
</script>

<style lang="scss" scoped >
.box-center {
  width: 100%;
  padding: 15px;
  min-width: 1000px;
  padding-bottom: 100px;
}
</style>
