一、准备工作:
1、npm install wangeditor
2、文档地址:https://www.kancloud.cn/wangfupeng/wangeditor3/ISSUE.md
二、组件代码
<template>
<div>
<div id="editor" ref='myEditor'></div>
<slot></slot>
</div>
</template>
<script>
import WangEditor from 'wangeditor'
export default {
name: 'component-wangeditor',
data () {
return {
edit: ''
}
},
props: {
value: {
default: ''
},
config: {
default: () => {
return {}
}
},
uploadConfig: {
default: () => {
return {
method: 'http', // 支持custom(objurl)和http(服务器)和base64
url: '/'
}
}
}
},
computed: {
customConfig () {
return {
pasteF