当前位置:网站首页>Wangeditor uncaught (in promise) error: the editor instance already exists in the initialization node, and the edit cannot be created repeatedly
Wangeditor uncaught (in promise) error: the editor instance already exists in the initialization node, and the edit cannot be created repeatedly
2022-07-21 04:52:00 【Get a cat first】
Use wangEditor An error is as follows :
Uncaught (in promise) Error: The initialization node already has an editor instance , Cannot create edits repeatedly
as a result of : The reason why the editor was created repeatedly .
There are two pop ups for adding and modifying in my project , Therefore, the compiler is created repeatedly .
terms of settlement :
Use editor.destroy();
let editor;
method:{
creatDom(){
editor = new E('#div1');// The rich text editor creates , Access to the node
// To configure server Address of the interface
editor.config.uploadImgServer = 'http://localhost:9090/files/editor/upload';
editor.config.uploadFileName = 'file';// Set the name of the file upload
editor.create();// establish .
},
// Here is the new pop-up window
add(){
this.dialogVisible = true;
this.form = {
};
// Because only after the pop-up window starts ,div Nodes will be created , Then you can only create a rich text editor after it .
this.$nextTick(()=>{
if (editor==null){
this.creatDom();
}else {
editor.destroy();// Here's a judgment , Determine whether the editor is created , If it is created, destroy it first .
this.creatDom();
}
});
},
// Here is the modification pop-up window
handleEdit(row){
this.form = JSON.parse((JSON.stringify(row)));
this.dialogVisible = true;
this.$nextTick(()=>{
if (editor==null){
this.creatDom();
editor.txt.html(row.content);
}else {
editor.destroy();// Here's a judgment , Determine whether the editor is created , If it is created, destroy it first .
this.creatDom();
editor.txt.html(row.content);
}
});
},
}
Talk is cheap,show me the code!—— Firewood studio !
边栏推荐
- Operation skills of markdown in jupyter
- "Object.defineproperty" [mandatory for interview business]
- 【云原生之kubernetes】kubernetes集群下初始化容器的使用方法
- 一维卷积英语电影评论情感分类项目
- FigDraw 13. SCI 文章绘图之桑葚图及文章复现(Sankey)
- DNA 8. Mutation heterogeneity of cancer and search for new cancer driver genes (mutsigcv)
- 网络安全架构:安全架构公理
- HDF5 library version mismatched error solution
- nc (NetCat) 网络安全工具介绍
- Jupyternotebook plug-in management and installation
猜你喜欢
DNA 7. 基因组拷贝数变异分析及可视化 (GISTIC2.0)
SCS【1】今天开启单细胞之旅,述说单细胞测序的前世今生
学会如何选择图表类型,小白也能玩转数据分析
Operation skills of markdown in jupyter
IDEA中如何连接数据库并显示数据库信息。
整数及浮点数在内存中的存储
RNA 24. Timer, an online gadget for TCGA based analysis of immune infiltrating cells in SCI articles
Static routing - Comprehensive Experiment
Three handshakes and four disconnects in TCP
DNA 8. Mutation heterogeneity of cancer and search for new cancer driver genes (mutsigcv)
随机推荐
掌握这些插件,分分钟提高你的办公效率90%!
【leetcode】150 逆波兰表达式求值
Study on immune related factors between TMB and ICI response in if:12+ different cancers
学会如何选择图表类型,小白也能玩转数据分析
Apktool回编译问题解决方案总结
IF:12+ 不同癌症中TMB与ICI反应之间的免疫相关因素研究
How to cultivate real data analysis thinking? Attached with practical cases
「Object.defineProperty」【面试业务必备】
Account and authority management
【FPGA教程案例32】通信案例2——基于FPGA的FSK调制信号产生
基于STM32设计的动态密码锁
VAE图片生成实战
If:4+ iron metabolism and immune related gene markers predict clinical outcomes and molecular characteristics of triple negative breast cancer
Three handshakes and four disconnects in TCP
關於XML 編輯工具
持续更新文章I‘m back
安全开发之IP地址伪造
NDK programming -- JNI tool class call
[latex] miktex+texstudio installation and configuration of thesis writing environment
Deep parsing of custom types