已废弃
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

45 lines
1.4 KiB

<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<title>layui</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all">
<link rel="stylesheet" href="/static/css/public.css" media="all">
</head>
<body>
<div id="test2" class="demo-tree"></div>
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>
var data;
layui.use(['form', 'layer','dropdown','tree'], function () {
var $ = layui.jquery,
tree = layui.tree;
test = tree.render({
elem: '#test2'
,showCheckbox: true //是否显示复选框
,data: []
});
$.ajax({
url: "/repository/treeMenus?adminorg=0",
type: 'get',
dataType: 'json',
contentType: "application/json;charset=utf-8",
beforeSend: function () {
},
success: function (d) {
var data2 = d.data;
test.reload({
data:data2
});
},
});
})
</script>
</body>
</html>