2.1.0
This commit is contained in:
@@ -134,8 +134,8 @@ layui.use('laydate', function(){
|
||||
elem: '#test2'
|
||||
,format: 'y年MM月dd日'
|
||||
//,value: new Date(2017,7,20)
|
||||
//,min: -1 //负数代表为n天前,正数代表为n天后。或这种格式:min: '2017-8-20'
|
||||
//,max: 1 //最大日期为n天后
|
||||
,min: '2016-9-20'
|
||||
,max: '2018-9-20'
|
||||
,ready: function(date){
|
||||
console.log(date);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ body{padding: 20px;}
|
||||
<button class="layui-btn" data-type="isAll">验证是否全选</button>
|
||||
</div>
|
||||
|
||||
<table class="layui-table" lay-data="{width:900, height:330, url:'json/table/demo1.json', page:true, id:'test'}" lay-filter="test">
|
||||
<table class="layui-table" lay-data="{width:900, height:'full-100', url:'json/table/demo1.json', page:true, id:'test'}" lay-filter="test">
|
||||
<thead>
|
||||
<tr>
|
||||
<th lay-data="{checkbox:true, fixed: true}"></th>
|
||||
@@ -31,7 +31,7 @@ body{padding: 20px;}
|
||||
<th lay-data="{field:'sex', width:80}">性别</th>
|
||||
<th lay-data="{field:'city', width:100}">城市</th>
|
||||
<th lay-data="{field:'sign', width:150}">签名</th>
|
||||
<th lay-data="{field:'experience', width:80, sort: true}">积分</th>
|
||||
<th lay-data="{field:'experience', width:80, sort: true, edit: 'text'}">积分</th>
|
||||
<th lay-data="{field:'ip', width:120}">IP</th>
|
||||
<th lay-data="{field:'logins', width:100}">登入次数</th>
|
||||
<th lay-data="{field:'joinTime', width:120}">加入时间</th>
|
||||
@@ -61,13 +61,13 @@ body{padding: 20px;}
|
||||
<th lay-data="{field:'ip', width:120}">IP</th>
|
||||
<th lay-data="{field:'logins', width:100, sort: true}">登入次数</th>
|
||||
<th lay-data="{field:'joinTime', width:120}">加入时间</th>
|
||||
<th lay-data="{fixed: 'right', toolbar: '#barDemo', width:150, align:'center'}">操作</th>
|
||||
<th lay-data="{fixed: 'right', toolbar: '#barDemo', width:150}">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<script type="text/html" id="usernameTpl">
|
||||
<a href="" class="layui-table-link">{{d.username}}</a>
|
||||
<a href="" class="layui-table-link">{{d.username || ''}}</a>
|
||||
</script>
|
||||
<script type="text/html" id="LAY_table_tpl_email">
|
||||
<span {{# if(!d.activate){ }}style="color:#999"{{# } }}>{{ d.email }}</span>
|
||||
@@ -256,6 +256,7 @@ layui.use('table', function(){
|
||||
,{field: 'experience', title: '积分', width: 80, sort: true}
|
||||
]]
|
||||
|
||||
,id:'test111'
|
||||
,skin: 'row' //表格风格
|
||||
,even: true
|
||||
//,size: 'lg' //尺寸
|
||||
@@ -279,7 +280,6 @@ layui.use('table', function(){
|
||||
,data = obj.data //得到所在行所有键值
|
||||
,field = obj.field; //得到字段
|
||||
|
||||
data[field] = value; //更新缓存中的值
|
||||
});
|
||||
|
||||
//监听工具条
|
||||
@@ -295,6 +295,11 @@ layui.use('table', function(){
|
||||
}
|
||||
});
|
||||
|
||||
//监听排序
|
||||
table.on('sort(test)', function(obj){
|
||||
console.log(this, obj)
|
||||
});
|
||||
|
||||
|
||||
var $ = layui.jquery, active = {
|
||||
getCheckData: function(){
|
||||
|
||||
@@ -51,14 +51,19 @@ hr{margin: 30px 0;}
|
||||
|
||||
<hr>
|
||||
|
||||
<button type="button" class="layui-btn" id="test3"><i class="layui-icon"></i>上传文件</button>
|
||||
<button type="button" class="layui-btn layui-btn-primary" id="test33"><i class="layui-icon"></i>换个样式</button>
|
||||
<button type="button" class="layui-btn test333" lay-data="{size:10,url:'a'}" id="test3"><i class="layui-icon"></i>上传文件</button>
|
||||
<button type="button" class="layui-btn layui-btn-primary test333" lay-data="{size:20,url:'b'}" id="test33"><i class="layui-icon"></i>换个样式</button>
|
||||
|
||||
<button type="button" class="layui-btn" id="test4"><i class="layui-icon"></i>上传视频</button>
|
||||
<button type="button" class="layui-btn" id="test5"><i class="layui-icon"></i>上传音频</button>
|
||||
|
||||
<hr>
|
||||
|
||||
<button class="layui-btn testm" lay-data="{url: '/a/'}">参数设在元素上</button>
|
||||
<button class="layui-btn testm" lay-data="{url: '/b/', accept: 'file',size:5}">参数设在元素上</button>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="layui-upload">
|
||||
<button type="button" class="layui-btn layui-btn-normal" id="test6">选择文件</button>
|
||||
<button type="button" class="layui-btn" id="test7">开始上传</button>
|
||||
@@ -184,13 +189,26 @@ layui.use('upload', function(){
|
||||
|
||||
|
||||
upload.render({
|
||||
elem: '#test3'
|
||||
,url: ''
|
||||
elem: '.test333'
|
||||
,url: 'a'
|
||||
,accept: 'file'
|
||||
,before: function(obj){
|
||||
console.log(this.item);
|
||||
}
|
||||
,done: function(res){
|
||||
console.log(res)
|
||||
}
|
||||
});
|
||||
|
||||
upload.render({
|
||||
elem: '.testm'
|
||||
,done: function(res, index, upload){
|
||||
//获取当前触发上传的元素,一般用于 elem 绑定 class 的情况,注意:此乃 layui 2.1.0 新增
|
||||
var item = this.item;
|
||||
}
|
||||
})
|
||||
|
||||
/*
|
||||
upload.render({
|
||||
elem: '#test33'
|
||||
,url: ''
|
||||
@@ -198,7 +216,7 @@ layui.use('upload', function(){
|
||||
,done: function(res){
|
||||
console.log(res)
|
||||
}
|
||||
});
|
||||
});*/
|
||||
|
||||
upload.render({
|
||||
elem: '#test4'
|
||||
|
||||
Reference in New Issue
Block a user