Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
贤心 committed Aug 18, 2018
1 parent 72253f6 commit e2a2c08
Show file tree
Hide file tree
Showing 23 changed files with 2,201 additions and 504 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "layui",
"main": "src/layui.js",
"version": "2.3.0",
"version": "2.4.0",
"homepage": "https://github.com/sentsin/layui",
"authors": [
"sentsin <[email protected]>"
Expand Down
94 changes: 94 additions & 0 deletions examples/colorpicker.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>颜色拾取器 - layui</title>

<link rel="stylesheet" href="../src/css/layui.css">

<style type="text/css">
#test1,#test2,#test3,#test4,#test5,#test6{margin-left: 50px; margin-top: 70px;}
</style>

<style>
body{padding:20px;}
</style>
</head>
<body>

<div class="layui-container">
<div class="layui-row">
<div>
<div id="test1"></div>
</div>
<div>
<div id="test2"></div>
</div>
<div>
<div id="test3"></div>
</div>
<div>
<div id="test4"></div>
</div>
<div>
<div id="test5"></div>
</div>
<div>
<div id="test6"></div>
</div>
</div>
</div>

<script src="../src/layui.js"></script>
<script>
layui.use('colorpicker', function(){
var colorpicker = layui.colorpicker;

colorpicker.render({
elem: '#test1'
,predefine: true //开启预定义颜色
,prededata: ['#F00','#0F0','#00F','rgb(255, 69, 0)','rgba(255, 69, 0, 0.5)']
,change: function(color){
console.log(color)
}
});
colorpicker.render({
elem: '#test2'
,bgcolor: 'rgba(218, 121, 157, 0.5)' //设置默认色
,predefine: true
,alpha: true //开启透明度
,format: 'rgb'
,change: function(color){
console.log(color)
}
});
colorpicker.render({
elem: '#test3'
,bgcolor: '#06eaee'
,alpha: true
,format: 'rgb' //设置输入显示格式为rgb
});
colorpicker.render({
elem: '#test4'
,bgcolor: '#06eeb8'
,predefine: true //开启预定义色
,format: 'rgb'
});
colorpicker.render({
elem: '#test5'
,bgcolor: '#ffd900'
,predefine: true
,size: 'mini'
});
colorpicker.render({
elem: '#test6'
,bgcolor: '#F00'
,predefine: true
,prededata: ['#F00','#0F0','#00F','rgb(255, 69, 0)','rgba(255, 69, 0, 0.5)']
,size: 'xs'
});
})
</script>
</body>
</html>
10 changes: 5 additions & 5 deletions examples/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@
<option value="音乐">音乐</option>
<option value="旅行">旅行</option>
<option value="读书">读书</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="1">layer</option>
<option value="2" disabled>laydate</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="4">layim</option>
<option value="5">laypage</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
Expand Down Expand Up @@ -210,7 +210,7 @@
,'phone': 11111111111
,'email': '[email protected]'
,'password': 123123
,'quiz': 2
//,'quiz': 2
,'interest': 3
,'like[write]': true
//,'open': false
Expand Down
2 changes: 1 addition & 1 deletion examples/json/table/demo1.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
,"email": "[email protected]"
,"sex": ""
,"city": "浙江杭州"
,"sign": "点击此处,显示更多。当内容超出时,点击单元格会自动显示更多内容"
,"sign": "鼠标移动到此处,可以通过点击单元格右侧的下拉图标,查看到被隐藏的全部内容"
,"experience": "7"
,"ip": "192.168.0.8"
,"logins": 0
Expand Down
75 changes: 75 additions & 0 deletions examples/json/table/demo3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"status": 200
,"message": ""
,"total": 3000000
,"data": {
"list": [{
"id": "10001"
,"username": "杜甫3"
,"email": "[email protected]"
,"sex": ""
,"city": "浙江杭州"
,"sign": "鼠标移动到此处,可以通过点击单元格右侧的下拉图标,查看到被隐藏的全部内容。"
,"experience": "7"
,"ip": "192.168.0.8"
,"logins": 0
,"joinTime": "2016-10-14"
}, {
"id": "10002"
,"username": "李白3"
,"email": "[email protected]"
,"sex": ""
,"city": "浙江杭州"
,"sign": "君不见,黄河之水天上来,奔流到海不复回。 君不见,高堂明镜悲白发,朝如青丝暮成雪。 人生得意须尽欢,莫使金樽空对月。 天生我材必有用,千金散尽还复来。 烹羊宰牛且为乐,会须一饮三百杯。 岑夫子,丹丘生,将进酒,杯莫停。 与君歌一曲,请君为我倾耳听。(倾耳听 一作:侧耳听) 钟鼓馔玉不足贵,但愿长醉不复醒。(不足贵 一作:何足贵;不复醒 一作:不愿醒/不用醒) 古来圣贤皆寂寞,惟有饮者留其名。(古来 一作:自古;惟 通:唯) 陈王昔时宴平乐,斗酒十千恣欢谑。 主人何为言少钱,径须沽取对君酌。 五花马,千金裘,呼儿将出换美酒,与尔同销万古愁。"
,"experience": "9"
,"ip": "192.168.0.8"
,"logins": "106"
,"joinTime": "2016-10-14"
,"LAY_CHECKED": true
}, {
"id": "10003"
,"username": "王勃"
,"email": "[email protected]"
,"sex": ""
,"city": "浙江杭州"
,"sign": "人生恰似一场修行"
,"experience": "8"
,"ip": "192.168.0.8"
,"logins": "106"
,"joinTime": "2016-10-14"
}, {
"id": "10004"
,"username": "李清照"
,"email": "[email protected]"
,"sex": ""
,"city": "浙江杭州"
,"sign": "人生恰似一场修行"
,"experience": "6"
,"ip": "192.168.0.8"
,"logins": "106"
,"joinTime": "2016-10-14"
}, {
"id": "10005"
,"username": "冰心"
,"email": "[email protected]"
,"sex": ""
,"city": "浙江杭州"
,"sign": "人生恰似一场修行"
,"experience": "64"
,"ip": "192.168.0.8"
,"logins": "106"
,"joinTime": "2016-10-14"
}, {
"id": "10006"
,"username": "贤心"
,"email": "[email protected]"
,"sex": ""
,"city": "浙江杭州"
,"sign": "人生恰似一场修行"
,"experience": "65"
,"ip": "192.168.0.8"
,"logins": "106"
,"joinTime": "2016-10-14"
}]
}
}
55 changes: 55 additions & 0 deletions examples/slider.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>滑块 - layui</title>

<link rel="stylesheet" href="../src/css/layui.css">

<style>
body{padding:20px;}
p{font-size: 18px; margin: 20px 0 50px;}
</style>
</head>
<body>

<div class="layui-container">
<div class="layui-row">
<div class="layui-col-xs8">
<p>默认滑块</p>
<div id="slideTest1"></div>
</div>
</div>
</div>

<script src="../src/layui.js"></script>
<script>

layui.use('slider', function(){
var slider = layui.slider;
slider.render({
elem: '#slideTest1'
// ,min: 0 //最小值
// ,max: 100 //最大值
// ,value: 40 //初始值
// ,step: 10 //间隔值
// ,showstep: true //间隔点
// ,tips: false //关闭提示文本
// ,input: true //输入框
// ,range: true //范围选择
// ,sliderValue: function(value){ //回调实时显示当前值
// console.log(value)
// }
// ,setTips: function(value){ //自定义提示文本
// return '离世界末日还有' + value + '天';
// }
// ,vertical: true //垂直滑块,默认横向
// ,height: '400' //配合 vertical 参数使用,默认200px
// ,disabled: true //禁用滑块
// ,color: '#2F4056' //主题色
});
});
</script>
</body>
</html>
Loading

0 comments on commit e2a2c08

Please sign in to comment.