文档地址
安装
代码语言:javascript复制npm install mavon-editor --save
在组件引入,也可在全局引入
代码语言:javascript复制import Vue from "vue";
import mavonEditor from "mavon-editor";
import "mavon-editor/dist/css/index.css";
Vue.use(mavonEditor);
完整代码
代码语言:javascript复制<template>
<div class="box">
<mavon-editor v-model="content" @change="changeCtx"></mavon-editor>
</div>
</template>
<script>
import Vue from "vue";
import mavonEditor from "mavon-editor";
import "mavon-editor/dist/css/index.css";
Vue.use(mavonEditor);
export default {
data() {
return {
content: "",
};
},
mounted() {},
methods: {
changeCtx(e) {
console.log(e);
},
},
};
</script>
<style lang="less" scoped>
</style>