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