<template>
<Content class="content">
<Row :gutter="16" type="flex" align="top" class="row-wrapper">
<Col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="col">
<Card shadow class="card-wrapper">
<!-- <p slot="title" class="title">上传文件</p> -->
<!-- <div>写文章</div> -->
<div class="write">
<MediumEditor />
</div>
</Card>
</Col>
</Row>
</Content>
</template>
添加css代码
<style scoped>.col { margin: 15px 0; display: block; height: 100%; overflow: auto;}.write{ word-wrap: break-word; overflow: hidden; font-size: 16px;}</style> methods: {
initEditor() {
let option = {};
// 实例化时,传入要生成编辑器的容器节点selector,以及编辑器的配置项option
this.editor = new MediumEditor(this.$el, this.option);
},
destroyEditor() {
this.editor.destroy();
}
}
end