1,首先最重要的是引入官方的layui.js layui.css文件
2,在自己的项目中新建一个目录 再在该目录下建一个js文件,js中写入
layui.define(['layer', 'form'], function(exports){
var layer = layui.layer
,form = layui.form;
layer.msg('Hello World');
exports('index', {}); //注意,这里是模块输出的核心,模块名必须和use时的模块名一致
});
3,在script的标签下写入这个,就能使用index模块
layui.config({
base: '/res/js/modules/' //你的模块目录
}).use('index'); //加载入口
4,var index=layui.index();
5,layui页面加载简单模式 http://blog.csdn.net/qq_34495753/article/details/78645380
6.layui的笔记参考 https://notemi.cn/layui---classic-modular-front-end-frame--entry.html
分页 http://blog.csdn.net/qq_19430115/article/details/70673148