name:'Vue2Editor',
props: ['content','disabled'],
data() {return{
strHtml:this.content,
uploaderUrl:'https://up.qbox.me',//上传路径放至七牛
imgDomain: 'http://xxx.xxx.net/',//文件所在域名
id: this.uniqueId(),
customToolbar:defaultBar
}
},
components: {'vue2-editor': VueEditor
},
watch: {
strHtml(newval) {//实时监控编辑器内容变化,使父组件能够实时获取输入内容
this.$emit('change', newval);
},
content(newval) {//父组件实时更新数据流向子组件
this.strHtml =newval
}
},
methods: {
handleImageAdded(file, Editor, cursorLocation, resetUploader) {/**
* 上传图片操作(上传至七牛)
let formData = new FormData();
let type = file.name.split('.');
if (type.length < 2) {
return f