abstract:<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title> <link rel="styl
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" type="text/css" href="layui-v2.4.5/layui/css/layui.css">
<script src="layui-v2.4.5/layui/layui.js"></script>
<style>
.header span{background:#009688;color:white;padding:10px;marign-left:30px;line-height:32px;}
.header button{float:right;background:#009688;color:white;}
.header{border-bottom:2px solid #009688;}
</style>
</head>
<body style="padding:10px;">
<div class="header">
<span>管理员列表</span>
<button class="layui-btn layui-btn-primary layui-btn-sm">添加</button>
</div>
<table class="layui-table">
<thead>
<tr>
<th>ID</th>
<th>用户名</th>
<th>性别</th>
<th>城市</th>
<th>签名</th>
<th>积分</th>
<th>职业</th>
</tr>
</thead>
<tbody>
<tr>
<td>贤心</td>
<td>汉族</td>
<td>1989-10-14</td>
<td>人生似修行</td>
<td>汉族</td>
<td>1989-10-14</td>
<td>
<button class="layui-btn layui-btn-xs">编辑</button>
<button class="layui-btn layui-btn-danger layui-btn-xs">删除</button>
</td>
</tr>
<tr>
<td>张爱玲</td>
<td>汉族</td>
<td>1920-09-30</td>
<td>于千万</td>
<td>汉族</td>
<td>1989-10-14</td>
<td>
<button class="layui-btn layui-btn-xs">编辑</button>
<button class="layui-btn layui-btn-danger layui-btn-xs">删除</button></td>
</tr>
<tr>
<td>Helen Keller</td>
<td>拉丁美裔</td>
<td>1880-06-27</td>
<td> Life is either</td>
<td>汉族</td>
<td>1989-10-14</td>
<td>
<button class="layui-btn layui-btn-xs">编辑</button>
<button class="layui-btn layui-btn-danger layui-btn-xs" onclick="del()">删除</button></td>
</tr>
</tbody>
</table>
<script>
layui.use(['layer'], function(){
var layer = layui.layer;
});
// 在使用layui弹出层时,若将此绑定在<a>,<form><input type="submit">,<button></form>等上面会出现闪退现象。因为这些标签都有默认事件
function del(){
layer.confirm('确定要删除吗?', {
icon:2,
btn: ['确定', '取消']
}, function(index, layero){
//按钮【按钮一】的回调
}, function(index){
//按钮【按钮二】的回调
});
}
</script>
</body>
</html>
Correcting teacher:查无此人Correction time:2019-05-07 09:50:33
Teacher's summary:完成的不错。layui框架非常不错,多了解它的功能。继续加油。