abstract:<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>列表</title> <link rel="stylesh
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>列表</title>
<link rel="stylesheet" href="layui/css/layui.css">
<style>
.header span{background: #009688;color: #fff;padding: 10px;margin-left: 30px;line-height: 32px;}
.header button{float: right}
.header{border-bottom: 2px solid #009688;}
</style>
<script src="layui/layui.js"></script>
</head>
<body style="padding: 10px;">
<div class="header">
<span>中国功夫明星列表</span>
<button class="layui-btn layui-btn-sm">添加</button>
</div>
<table class="layui-table" >
<thead>
<tr>
<th >ID</th>
<th >姓名</th>
<th >性别</th>
<th >年龄</th>
<th >操作</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>成龙</td>
<td>男</td>
<td>保密</td>
<td>
<button class="layui-btn layui-btn-sm">编辑</button>
<button class="layui-btn layui-btn-sm" onclick="del()">删除</button>
</td>
</tr>
</tbody>
</table>
<script>
//JavaScript代码区域
layui.use('layer', function(){
var layer = layui.layer;
});
function del(){
layer.confirm('确定要删除吗?', {
icon:2,
btn: ['确定', '取消'] //可以无限个按钮
}
, function(index, layero){
//按钮【按钮一】的回调
}, function(index){
//按钮【按钮二】的回调
});
}
</script>
</body>
</html>
Correcting teacher:灭绝师太Correction time:2019-02-18 17:20:47
Teacher's summary:小的模块知识点一点一点积累,就是一个整体继续加油!