65 lines
1.6 KiB
HTML
65 lines
1.6 KiB
HTML
<!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>
|
||
<body>
|
||
<div id="view"></div>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</body>
|
||
<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>
|
||
|
||
<script src="/layui/layui.js"></script>
|
||
<script src="/js/jquery-3.2.1.js"></script>
|
||
<script src="/js/CommonConfig.js"></script>
|
||
<script>
|
||
headerModel=3;
|
||
$('#header').load("/html/header.html");
|
||
|
||
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)
|
||
});
|
||
})
|
||
|
||
</script>
|
||
|
||
<style>
|
||
|
||
</style>
|
||
</html> |