• <tfoot id='WDYhR'></tfoot>
  • <small id='WDYhR'></small><noframes id='WDYhR'>

      <bdo id='WDYhR'></bdo><ul id='WDYhR'></ul>
    <i id='WDYhR'><tr id='WDYhR'><dt id='WDYhR'><q id='WDYhR'><span id='WDYhR'><b id='WDYhR'><form id='WDYhR'><ins id='WDYhR'></ins><ul id='WDYhR'></ul><sub id='WDYhR'></sub></form><legend id='WDYhR'></legend><bdo id='WDYhR'><pre id='WDYhR'><center id='WDYhR'></center></pre></bdo></b><th id='WDYhR'></th></span></q></dt></tr></i><div id='WDYhR'><tfoot id='WDYhR'></tfoot><dl id='WDYhR'><fieldset id='WDYhR'></fieldset></dl></div>

    <legend id='WDYhR'><style id='WDYhR'><dir id='WDYhR'><q id='WDYhR'></q></dir></style></legend>

        LayUI tree组件实现展开全部和折叠全部的功能

        时间:2024-10-27
        • <bdo id='jHCG6'></bdo><ul id='jHCG6'></ul>

                  <tbody id='jHCG6'></tbody>
                • <tfoot id='jHCG6'></tfoot>

                  <small id='jHCG6'></small><noframes id='jHCG6'>

                  <i id='jHCG6'><tr id='jHCG6'><dt id='jHCG6'><q id='jHCG6'><span id='jHCG6'><b id='jHCG6'><form id='jHCG6'><ins id='jHCG6'></ins><ul id='jHCG6'></ul><sub id='jHCG6'></sub></form><legend id='jHCG6'></legend><bdo id='jHCG6'><pre id='jHCG6'><center id='jHCG6'></center></pre></bdo></b><th id='jHCG6'></th></span></q></dt></tr></i><div id='jHCG6'><tfoot id='jHCG6'></tfoot><dl id='jHCG6'><fieldset id='jHCG6'></fieldset></dl></div>
                • <legend id='jHCG6'><style id='jHCG6'><dir id='jHCG6'><q id='jHCG6'></q></dir></style></legend>
                • html代码部分:
                  <div id="menuTree" class="demo-tree-more"></div>
                  js组件渲染代码
                     tree.render({
                         elem: '#menuTree',
                         data: getData(),  //ajax获取data数据
                         showCheckbox: true,  //是否显示复选
                         id: 'demoId' 
                     });
                  点击全部展开和全部折叠按钮事件
                  //menuTree换成你自己的id就行
                  var treeContainer = document.querySelector('#menuTree');
                  var expandIcons = treeContainer.querySelectorAll('.layui-icon-addition');  //展开代码
                  var expandIcons = treeContainer.querySelectorAll('.layui-icon-subtraction'); //折叠代码
                  expandIcons.forEach(function(icon) {
                      var clickEvent = new MouseEvent('click', {
                      'view': window,
                      'bubbles': true,
                      'cancelable': true
                  });
                  icon.dispatchEvent(clickEvent);
                  });
                   
                  上一篇:layui实现打印layer.open弹窗内容 下一篇:没有了

                  相关文章

                  <legend id='5rme2'><style id='5rme2'><dir id='5rme2'><q id='5rme2'></q></dir></style></legend>
                    <tfoot id='5rme2'></tfoot>

                    • <bdo id='5rme2'></bdo><ul id='5rme2'></ul>

                      <small id='5rme2'></small><noframes id='5rme2'>

                      <i id='5rme2'><tr id='5rme2'><dt id='5rme2'><q id='5rme2'><span id='5rme2'><b id='5rme2'><form id='5rme2'><ins id='5rme2'></ins><ul id='5rme2'></ul><sub id='5rme2'></sub></form><legend id='5rme2'></legend><bdo id='5rme2'><pre id='5rme2'><center id='5rme2'></center></pre></bdo></b><th id='5rme2'></th></span></q></dt></tr></i><div id='5rme2'><tfoot id='5rme2'></tfoot><dl id='5rme2'><fieldset id='5rme2'></fieldset></dl></div>