layui Tree的使用


<!DOCTYPE html>
<html>
<head>
    <title>Tree</title>
    <link rel="stylesheet" type="text/css" href="layui/css/layui.css">
    <style type="text/css">
        body .layui-tree-skin-shihuang .layui-tree-branch{color: blue;}  
    </style>
</head>
<body>

  <ul id="demo"></ul>

</body>
<script src="layui/layui.js"></script>
<script type="text/javascript">
    layui.use('tree', function(){
      layui.tree({
          elem:'#demo',
          skin:'shihuang',
          nodes: [{ //节点
            name: '父节点1'
            ,children: [{
              name: '子节点11'
            },{
              name: '子节点12'
            }]
          },{
            name: '父节点2(可以点左侧箭头,也可以双击标题)'
            ,children: [{
              name: '子节点21'
              ,children: [{
                name: '子节点211'
              }]
            }]
          }]
      });
    });
</script>
</html>

官网文档:

https://www.layui.com/doc/modules/tree.html

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM