1.tab选项卡
let $,element;
layui.use(['jquery','element'],function(){
$ =layui.jquery,element=layui.element;
$.ajax({
url:'${pageContext.request.contextPath }/permission.action?methodName=menus'
,dataType:'json'
,success:function(data){
console.log(data);
let htmlstr='';
$.each(data,function(i,n){
htmlstr += '<li class="layui-nav-item layui-nav-itemed">';
htmlstr += ' <a class="" href="javascript:;">'+data[i].text+'</a>';
//判断当前一级节点是否存在子节点
if(data[i].hasChildren){
htmlstr += '<dl class="layui-nav-child">';
let children =data[i].children;
$.each(children,function(index,node){
htmlstr += '<dd><a href="javascript:;" onClick="openTabs(\''+children[index]