biliob/Web/html/body/user.html

65 lines
1.6 KiB
HTML
Raw Normal View History

2024-10-29 18:29:56 +08:00
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>用户中心</title>
<link rel="stylesheet" href="/layui/css/layui.css">
</head>
<body>
<div id="header"></div>
2024-10-30 18:27:37 +08:00
<body>
<div id="view"></div>
2024-10-29 18:29:56 +08:00
</body>
2024-10-30 18:27:37 +08:00
<script id="demo" type="text/html">
<h3>{{ d.title }}</h3>
<ul>
{{# layui.each(d.list, function(index, item){ }}
<li>
<span>{{ item.modname }}</span>
<span>{{ item.alias }}</span>
<span>{{ item.site || '' }}</span>
</li>
{{# }); }}
{{# if(d.list.length === 0){ }}
无数据
{{# } }}
</ul>
</script>
2024-10-29 18:29:56 +08:00
<script src="/layui/layui.js"></script>
<script src="/js/jquery-3.2.1.js"></script>
<script src="/js/CommonConfig.js"></script>
<script>
2024-11-01 00:15:12 +08:00
headerModel=4;
2024-10-29 18:29:56 +08:00
$('#header').load("/html/header.html");
2024-10-30 18:27:37 +08:00
layui.use(['form', 'laytpl'], function () {
var form = layui.form;
var layer = layui.layer;
var laytpl = layui.laytpl
var data = { //数据
"title":"Layui常用模块"
,"list":[{"modname":"弹层","alias":"layer","site":"layer.layui99.com"},{"modname":"表单","alias":"form"}]
}
var getTpl = $("#demo").get(0).innerHTML
,view = document.getElementById('view');
laytpl(getTpl).render(data, function(html){
view.innerHTML = html;
console.log(html)
});
})
2024-10-29 18:29:56 +08:00
</script>
<style>
</style>
</html>