本篇文章教大家如何运用layui数据添加页面的前端布局,有一定的参考价值,有需要的朋友可以参考一下,希望对大家有所帮助。
layui数据添加页面的前端布局
1、在首页面增加一个学生信息添加,代码如下:
<title>学生信息添加</title> <script src="../public/jquery-1.8..js"></script> <script src="../public/layui/layui.js"></script> <link rel="stylesheet" href="../public/layui/css/layui.css">
2、添加from表单
<form class="layui-form"> <!-- 提示:如果你不想用form,你可以换成div等任何一个普通元素 --> <div class="layui-form-item"> <label class="layui-form-label">姓名</label> <div class="layui-input-block"> <input type="text" number="" placeholder="请输入" autocomplete="off" class="layui-input"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">学号</label> <div class="layui-input-block"> <input type="text" name="" placeholder="请输入" autocomplete="off" class="layui-input"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">性别</label> <div class="layui-input-block"> <input type="checkbox" name="like[write]" title="写作"> <input type="checkbox" name="like[read]" title="阅读"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">开关关</label> <div class="layui-input-block"> <input type="checkbox" lay-skin="switch"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">开关开</label> <div class="layui-input-block"> <input type="checkbox" checked lay-skin="switch"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">单选框</label> <div class="layui-input-block"> <input type="radio" name="sex" value="0" title="男"> <input type="radio" name="sex" value="1" title="女" checked> </div> </div> <div class="layui-form-item layui-form-text"> <label class="layui-form-label">请填写描述</label> <div class="layui-input-block"> <textarea placeholder="请输入内容" class="layui-textarea"></textarea> </div> </div> <div class="layui-form-item"> <div class="layui-input-block"> <button class="layui-btn" lay-submit lay-filter="*">立即提交</button> <button type="reset" class="layui-btn layui-btn-primary">重置</button> </div> </div> <!--