vue前端框架引入ueditor

1.首先我将ueditor(下载地址:https://ueditor.baidu.com/website/download.html 本人下载jsp-utf-8版)放在项目static下,

2.然后在需要使用ueditor编辑器的js(这里在newsdetail.js引入)引入ueditor的三个js

3.再在vue钩子函数mounted初始化ueditor

 mounted(){
		var ue = UE.getEditor('editor');
	},

4.最后在newsdetail.vue写入 

<script id="editor" type="text/plain" style="width:100%;height:300px;"></script>

温馨提醒:如果ueditor需要刷新一下网页才能出来的话,那就在var ue = UE.getEditor('editor');上面添加 UE.delEditor('editor');

 mounted(){
		UE.delEditor('editor');
	    var ue = UE.getEditor('editor');
	},

vue前端框架引入ueditor

vue前端框架引入ueditorvue前端框架引入ueditor