<template>
  <div>
    <div id="div1" style="width:100%;height:200px;"></div>
  </div>
</template>
<script>
import E from "wangeditor";
export default {
  data(){
    return{
      editor:null,
    }
  },
  mounted(){
    this.init();
  },
  methods:{
    init(){
      this.editor=new E ('#div1');
      this.editor.create();
    }
  }
}
</script>

放在mounted生命周期内

Logo

前往低代码交流专区

更多推荐