cnpm i vue-ueditor-wrap -S
import VueUeditorWrap from 'vue-ueditor-wrap'
components: {
VueUeditorWrap
}
// 或者在 main.js 里将它注册为全局组件
Vue.component('vue-ueditor-wrap',VueUeditorWrap)
<vue-ueditor-wrap v-model="msg"></vue-ueditor-wrap>
<template>
div class="hello">
vue-ueditor-wrap ref="ueditor" v-model="msg" :destroy="false" :config="config" style="width: 600px;margin: 0 auto;"></vue-ueditor-wrapbutton @click="showData" class="preview">保存内容</buttondiv>
>
script>
import VueUeditorWrap from 'vue-ueditor-wrap' // ES6 Module
export default {
name: HelloWorld,components: {
VueUeditorWrap
},data () {
return {
msg: 请输入内容 编辑器不自动被内容撑高
autoHeightEnabled: true 初始容器高度
initialFrameHeight: 240false 初始容器宽度
initialFrameWidth: 100%''
}
}
},mounted () {
},methods: {
showData () {
console.log(this.msg)
}
}
}
>