mirror of
https://gitee.com/layui/layui.git
synced 2025-10-15 18:55:04 +08:00
解决冲突
This commit is contained in:
8
examples/json/upload/demoLayEdit.json
Normal file
8
examples/json/upload/demoLayEdit.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"code": 0
|
||||
,"msg": ""
|
||||
,"data": {
|
||||
"src": "http://tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg"
|
||||
,"title": "图片名称"
|
||||
}
|
||||
}
|
@@ -23,7 +23,6 @@ body{padding: 50px 100px;}
|
||||
<input type="text" class="layui-input" id="test1">
|
||||
</div>
|
||||
|
||||
|
||||
<br><br><hr><br>
|
||||
|
||||
日期选择器:
|
||||
@@ -62,6 +61,21 @@ body{padding: 50px 100px;}
|
||||
|
||||
<br><br><hr><br>
|
||||
|
||||
|
||||
同时绑定多个:
|
||||
<div class="layui-inline">
|
||||
<input type="text" class="layui-input test-item">
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" class="layui-input test-item">
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" class="layui-input test-item">
|
||||
</div>
|
||||
|
||||
<br><br><hr><br>
|
||||
|
||||
|
||||
墨绿主题:
|
||||
<div class="layui-inline">
|
||||
<input type="text" class="layui-input" id="test6-1">
|
||||
@@ -120,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);
|
||||
}
|
||||
@@ -185,6 +199,14 @@ layui.use('laydate', function(){
|
||||
}
|
||||
});
|
||||
|
||||
//同时绑定多个
|
||||
lay('.test-item').each(function(){
|
||||
laydate.render({
|
||||
elem: this
|
||||
,trigger: 'click'
|
||||
});
|
||||
});
|
||||
|
||||
//自定义重要日
|
||||
var ins555 = laydate.render({
|
||||
elem: '#test555'
|
||||
|
@@ -34,8 +34,8 @@ layui.use('layedit', function(){
|
||||
var index = layedit.build('demo', {
|
||||
//hideTool: ['image']
|
||||
uploadImage: {
|
||||
url: '/upload/test/'
|
||||
,type: 'post'
|
||||
url: 'json/upload/demoLayEdit.json'
|
||||
,type: 'get'
|
||||
}
|
||||
//,tool: []
|
||||
//,height: 100
|
||||
|
29
examples/responsive.html
Normal file
29
examples/responsive.html
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
|
||||
<!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;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
|
||||
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
<div class="layui-hide-xs layui-show-sm-inline layui-show-md-block">
|
||||
移动:隐藏
|
||||
<br>平板:inline
|
||||
<br>PC:block
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
@@ -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>
|
||||
@@ -245,7 +245,8 @@ layui.use('table', function(){
|
||||
,width: 900
|
||||
//,height: 274
|
||||
,cols: [[ //标题栏
|
||||
{checkbox: true, LAY_CHECKED: true}
|
||||
{space: true, fixed: true}
|
||||
,{checkbox: true, LAY_CHECKED: true}
|
||||
,{field: 'id', title: 'ID', width: 80, sort: true}
|
||||
,{field: 'username', title: '用户名', width: 120}
|
||||
,{field: 'email', title: '邮箱', width: 150}
|
||||
@@ -255,6 +256,7 @@ layui.use('table', function(){
|
||||
,{field: 'experience', title: '积分', width: 80, sort: true}
|
||||
]]
|
||||
|
||||
,id:'test111'
|
||||
,skin: 'row' //表格风格
|
||||
,even: true
|
||||
//,size: 'lg' //尺寸
|
||||
@@ -278,7 +280,6 @@ layui.use('table', function(){
|
||||
,data = obj.data //得到所在行所有键值
|
||||
,field = obj.field; //得到字段
|
||||
|
||||
data[field] = value; //更新缓存中的值
|
||||
});
|
||||
|
||||
//监听工具条
|
||||
@@ -294,6 +295,16 @@ layui.use('table', function(){
|
||||
}
|
||||
});
|
||||
|
||||
//监听排序
|
||||
table.on('sort(test)', function(obj){
|
||||
console.log(this, obj)
|
||||
|
||||
return;
|
||||
table.reload('test', {
|
||||
height: 300
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
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