-
Notifications
You must be signed in to change notification settings - Fork 12
/
tree.html
47 lines (43 loc) · 1.36 KB
/
tree.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title></title>
<link rel="stylesheet" href="lib/layui-v2.4.5/css/layui.css">
<link rel="stylesheet" href="iconfont/iconfont.css">
<link rel="stylesheet" href="css/tree.css">
<script src="lib/layui-v2.4.5/layui.js"></script>
</head>
<body>
<ul id="demo"></ul>
<script>
layui.use(['tree', 'layer'], function(){
var layer = layui.layer
,$ = layui.jquery;
layui.tree({
elem: '#demo' //传入元素选择器
, skin: 'shihuang'
, nodes: [{ //节点
name: '父节点1'
, children: [{
name: '子节点11'
}, {
name: '子节点12'
}]
}, {
name: '父节点2(可以点左侧箭头,也可以双击标题)'
, children: [{
name: '子节点21'
, children: [{
name: '子节点211'
}]
}]
}]
});
});
</script>
</body>
</html>