解决:UEditor在模态框中编辑时还是显示上次的内容
//set content when UEditor loading success to avoid error of undefined in first times self.ue.addListener("ready", function () { self.ue.setContent(self.WorkPlan.content); }); //set content of UEditor when edit again self.ue.setContent(self.WorkPlan.content);
说明:
self.ue是实例化的UEditor
注释1:使用监听是避免UEditor还未加载完毕就填充内容,导致‘innerHTML’ of undefined 错误
注释2:每次编辑时替换UEditor中的内容
效果如下: