vue-cli和ueditor结合使用

下载ue。jsp版本放入static下然后






调用ue组件




//页面实例化

   
............... data(){ import '../../../static/Ueditor/ueditor.config' import '../../../static/Ueditor/ueditor.all'; import '../../../static/Ueditor/lang/zh-cn/zh-cn'; return:{ //记录ue ueInfo: "", uedoSerInfo: "", relationNews: "", uedocSerJlInfod: "", uedocSerJlInfoz: "", uedocSerJlInfot: "", } }, methods:{ fu:(){ //这样写可以防止innerHTML报错,也就是ue没有实例之前添加 UE.getEditor('genPeople').ready(function() { UE.getEditor('genPeople').setContent(res.data.dataMap.gys.genPeople); }); } }, mounted() { this.toSupplierFile2(); //实例话ue 公司创始人 this.ueInfo = UE.getEditor('genPeople', { toolbars: [['insertimage']], //多图上传 wordCount: false, //关闭字数统计 elementPathEnabled: false, //关闭elementPath initialFrameHeight: 400, //默认高 }); //实例话ue 发展历史 this.uedoSerInfo = UE.getEditor('progressHistory', { toolbars: [['insertimage']], //多图上传 wordCount: false, //关闭字数统计 elementPathEnabled: false, //关闭elementPath initialFrameHeight: 400, //默认高 }); //实例话ue 相关新闻 this.relationNews = UE.getEditor('relationNews', { toolbars: [['insertimage']], //多图上传 wordCount: false, //关闭字数统计 elementPathEnabled: false, //关闭elementPath initialFrameHeight: 400, //默认高 }); //实例话ue 相关单位 this.uedocSerJlInfod = UE.getEditor('relationUnit', { toolbars: [['insertimage']], //多图上传 wordCount: false, //关闭字数统计 elementPathEnabled: false, //关闭elementPath initialFrameHeight: 400, //默认高 }); //实例话ue 企业相关证件 this.uedocSerJlInfoz = UE.getEditor('relationImage', { toolbars: [['insertimage']], //多图上传 wordCount: false, //关闭字数统计 elementPathEnabled: false, //关闭elementPath initialFrameHeight: 400, //默认高 }); //实例话ue this.uedocSerJlInfot = UE.getEditor('other', { toolbars: [['insertimage']], //多图上传 wordCount: false, //关闭字数统计 elementPathEnabled: false, //关闭elementPath initialFrameHeight: 400, //默认高 }); }, destroyed() { //组件离开后销毁 this.ueInfo.destroy(); this.uedoSerInfo.destroy(); this.relationNews.destroy(); this.uedocSerJlInfod.destroy(); this.uedocSerJlInfoz.destroy(); this.uedocSerJlInfot.destroy(); this.$destroy(); }

你可能感兴趣的:(vue-cli和ueditor结合使用)