2021-04-06 16:33:58 +00:00
|
|
|
|
<p align="center">
|
2017-08-21 00:51:13 +00:00
|
|
|
|
<a href="http://www.layui.com">
|
2022-05-24 10:19:06 +00:00
|
|
|
|
<img src="https://unpkg.com/outeres/img/layui/logo-1.png" alt="layui" width="360">
|
2017-08-21 00:51:13 +00:00
|
|
|
|
</a>
|
|
|
|
|
</p>
|
2021-04-06 16:33:58 +00:00
|
|
|
|
<p align="center">
|
2022-05-24 10:19:06 +00:00
|
|
|
|
Classic modular front-end UI library
|
2017-08-21 00:51:13 +00:00
|
|
|
|
</p>
|
|
|
|
|
|
2021-04-06 16:56:02 +00:00
|
|
|
|
<p align="center">
|
2022-05-24 10:19:06 +00:00
|
|
|
|
<a href="https://www.npmjs.com/package/layui">
|
|
|
|
|
<img src="https://img.shields.io/npm/v/layui" alt="Version">
|
|
|
|
|
</a>
|
|
|
|
|
<a href="https://www.npmjs.com/package/layui">
|
|
|
|
|
<img src="https://img.shields.io/github/license/layui/layui" alt="License">
|
|
|
|
|
</a>
|
|
|
|
|
<a href="https://github.com/layui/layui/blob/master/dist/css/layui.css">
|
|
|
|
|
<img src="https://img.badgesize.io/layui/layui/master/dist/css/layui.css?compression=brotli&label=CSS Brotli size" alt="CSS Brotli size">
|
|
|
|
|
</a>
|
|
|
|
|
<a href="https://github.com/layui/layui/blob/master/dist/layui.js">
|
|
|
|
|
<img src="https://img.badgesize.io/layui/layui/master/dist/layui.js?compression=brotli&label=JS Brotli size" alt="JS Brotli size">
|
|
|
|
|
</a>
|
2017-09-01 12:28:59 +00:00
|
|
|
|
</p>
|
2021-04-06 16:33:58 +00:00
|
|
|
|
|
2017-08-21 00:51:13 +00:00
|
|
|
|
---
|
|
|
|
|
|
2022-05-24 16:46:38 +00:00
|
|
|
|
layui 是一套开源的 Web UI 组件库,采用自身经典的模块化规范,并遵循原生 HTML/CSS/JS 的开发方式,极易上手,拿来即用。其风格简约轻盈,而组件优雅丰盈,从源代码到使用方法的每一处细节都经过精心雕琢,非常适合网页界面的快速开发。layui 区别于那些基于 MVVM 底层的前端框架,却并非逆道而行,而是信奉返璞归真之道。准确地说,它更多是面向后端开发者,你无需涉足前端的各种工具,只需面对浏览器本身,让一切你所需要的元素与交互,从这里信手拈来。
|
2017-08-21 00:51:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## 快速上手
|
|
|
|
|
|
2021-03-31 06:07:23 +00:00
|
|
|
|
获得 layui 后,将其完整地部署到你的静态资源项目目录,你只需要引入下述两个文件:
|
2017-08-21 00:51:13 +00:00
|
|
|
|
|
2017-10-10 04:17:51 +00:00
|
|
|
|
```html
|
2017-08-21 00:51:13 +00:00
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html>
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="utf-8">
|
2022-05-18 15:33:36 +00:00
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
2021-03-31 06:07:23 +00:00
|
|
|
|
<title>开始使用 layui</title>
|
2022-05-18 15:36:23 +00:00
|
|
|
|
<link rel="stylesheet" href="./layui/css/layui.css">
|
2017-08-21 00:51:13 +00:00
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
|
2022-04-03 14:37:45 +00:00
|
|
|
|
<!-- 你的 HTML 代码 -->
|
2017-08-21 00:51:13 +00:00
|
|
|
|
|
2022-05-18 15:36:23 +00:00
|
|
|
|
<script src="./layui/layui.js"></script>
|
2017-08-21 00:51:13 +00:00
|
|
|
|
<script>
|
2022-04-03 14:37:45 +00:00
|
|
|
|
//一般直接写在一个 js 文件中
|
2017-08-21 00:51:13 +00:00
|
|
|
|
layui.use(['layer', 'form'], function(){
|
|
|
|
|
var layer = layui.layer
|
|
|
|
|
,form = layui.form;
|
|
|
|
|
|
2022-05-18 15:33:36 +00:00
|
|
|
|
//欢迎语
|
2017-08-21 00:51:13 +00:00
|
|
|
|
layer.msg('Hello World');
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|
|
|
|
|
```
|
|
|
|
|
|
2022-03-16 01:55:53 +00:00
|
|
|
|
## 阅读文档
|
2022-05-26 23:28:25 +00:00
|
|
|
|
[**最新文档**](https://layui.github.io/)
|
2022-03-16 01:55:53 +00:00
|
|
|
|
|
2022-03-16 01:57:56 +00:00
|
|
|
|
愿 layui 能成为你得心应手的 Web 界面解决方案,化作你方寸屏幕前的亿万字节!
|
2017-08-21 00:51:13 +00:00
|
|
|
|
|
2021-03-31 06:07:23 +00:00
|
|
|
|
## 贡献者
|
2022-05-24 10:19:06 +00:00
|
|
|
|
[贡献者列表](https://github.com/layui/layui/graphs/contributors)
|
2021-03-31 06:07:23 +00:00
|
|
|
|
|
2022-05-18 15:36:23 +00:00
|
|
|
|
> 大概是因为 layui 让开发者变得更懒,所以贡献者才如此之少。
|
|
|
|
|
|
2017-08-21 00:51:13 +00:00
|
|
|
|
## 相关
|
2022-05-24 10:19:06 +00:00
|
|
|
|
> layui 源官网已于2021年10月13日下线。
|
2022-03-16 01:43:58 +00:00
|
|
|
|
|
2022-03-16 01:50:26 +00:00
|
|
|
|
目前包括版本更新、文档等在内的所有日常维护,都以 Github 或 Gitee 项目主页为准。
|