Home > front end >  How do you this obtain judgment
How do you this obtain judgment

Time:10-01



Above is to increase TAB click on the left side of the menu bar on the right side, up to 10, is originally want to new, please close the other pages will pop up, this was no problem to do it, but click has been click menu page has appeared in the TAB on the right, will pop up the prompt, please help to look at and how to modify this problem, I don't know how to judge, the left side menu ever clicked increase indexOf lookup in the TAB on the right side also not line,


The function onClick (e, treeId, node) {
Var layuiTitle=document. QuerySelector (" layui - TAB - title ");
Var layuiTitleli=layuiTitle. QuerySelectorAll (" li ");

If (layuiTitleli. Length & gt;=10) {
Alert (" please close the other pages ")
return;
}
Xadmin. Add_tab (node. The name, node. Urls);

}

CodePudding user response:

Online, such as belt,,,,,

CodePudding user response:

//append a judgment whether there is a menu name TAB
Var found=false;
for(var i=0; IIf (layuiTitleli [I] innerHTML==node. The name) {//to judge the existence or non-existence of the current click TAB menu name
Found=true;
break;
}
}

If (layuiTitleli. Length>=10 & amp; & ! Found) {//more than 10 tabs and TAB there is no menu name to return
Alert (" please turn off other pages ");
return;
}
  • Related