update
This commit is contained in:
@@ -131,8 +131,17 @@ body{padding:20px;}
|
||||
|
||||
<br><br>
|
||||
|
||||
<blockquote class="layui-elem-quote"> Layui 正是你苦苦寻找的前端UI框架</blockquote>
|
||||
<blockquote class="layui-elem-quote layui-quote-nm"> Layui 正是你苦苦寻找的前端UI框架 Layui 正是你苦苦寻找的前端UI框架 Layui 正是你苦苦寻找的前端UI框架 Layui 正是你苦苦寻找的前端UI框架 Layui 正是你苦苦寻找的前端UI框架</blockquote>
|
||||
<blockquote class="layui-elem-quote layui-text">
|
||||
<p>Layui - 原生态模块化前端 UI 组件库</p>
|
||||
<p>Layui - 原生态模块化前端 UI 组件库</p>
|
||||
</blockquote>
|
||||
<blockquote class="layui-elem-quote layui-quote-nm">
|
||||
Layui - 原生态模块化前端 UI 组件库
|
||||
Layui - 原生态模块化前端 UI 组件库
|
||||
Layui - 原生态模块化前端 UI 组件库
|
||||
Layui - 原生态模块化前端 UI 组件库
|
||||
Layui - 原生态模块化前端 UI 组件库
|
||||
</blockquote>
|
||||
|
||||
<fieldset class="layui-elem-field">
|
||||
<legend>字段集区块 - 默认风格</legend>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"id": "10001"
|
||||
,"username": "杜甫"
|
||||
,"email": "test1@email.com"
|
||||
,"sex": "男"
|
||||
,"sex": "<strong>男</strong>"
|
||||
,"city": "浙江杭州"
|
||||
,"sign": "鼠标移动到此处,可以通过点击单元格右侧的下拉图标,查看到被隐藏的全部内容。"
|
||||
,"experience": 7
|
||||
|
||||
@@ -114,7 +114,7 @@ body{padding: 50px 100px;}
|
||||
<div class="layui-inline">
|
||||
<input type="text" class="layui-input" id="test6">
|
||||
</div>
|
||||
|
||||
<textarea></textarea>
|
||||
<button class="layui-btn" id="test9">外部事件触发</button>
|
||||
<div class="layui-inline">
|
||||
<input type="text" class="layui-input" id="test8">
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
{{# if(d.email.trim()){ }}
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
|
||||
{{# } }}
|
||||
<input type="checkbox" name="demoTableSwitch" lay-skin="switch" {{ d.demoTableSwitch }}>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="usernameTpl">
|
||||
@@ -111,11 +112,12 @@ layui.use(['table', 'dropdown'], function(){
|
||||
,layEvent: 'LAYTABLE_TIPS'
|
||||
,icon: 'layui-icon-tips'
|
||||
}]
|
||||
//,escape: false
|
||||
,cols: !1 ? [[ //仅用于测试
|
||||
{type: 'checkbox', fixed: 'left'}
|
||||
,{field:'id', title:'ID', width:80, fixed: 'left', unresize: true, sort: true, totalRowText: '合计:'}
|
||||
,{field:'username', title:'用户名', width:120, edit: 'text'}
|
||||
,{field:'email', title:'邮箱', hide: 0, width:150, edit: 'text'}
|
||||
,{field:'email', title:'邮箱 <i class="layui-icon layui-icon-email"></i>', hide: 0, width:150, edit: 'text'}
|
||||
,{field:'sex', title:'性别', width:80, edit: 'text', sort: true}
|
||||
,{field:'city', title:'城市', width:120}
|
||||
,{field:'sign', title:'签名'}
|
||||
@@ -125,7 +127,7 @@ layui.use(['table', 'dropdown'], function(){
|
||||
{type: 'checkbox', fixed: 'left'}
|
||||
,{field:'id', title:'ID', width:80, fixed: 'left', unresize: true, sort: true, totalRowText: '合计:'}
|
||||
,{field:'username', title:'用户名', width:120, edit: 'text', templet: '#usernameTpl'}
|
||||
,{field:'email', title:'邮箱', hide: 0, width:150, edit: 'text', templet: function(d){
|
||||
,{field:'email', title:'邮箱 <i class="layui-icon layui-icon-email"></i>', hide: 0, width:150, edit: 'text', templet: function(d){
|
||||
return '<em>'+ layui.util.escape(d.email) +'</em>'
|
||||
}}
|
||||
,{field:'sex', title:'性别', width:80, edit: 'text', sort: true}
|
||||
@@ -139,7 +141,7 @@ layui.use(['table', 'dropdown'], function(){
|
||||
,{field:'ip', title:'IP', width: 120}
|
||||
,{field:'logins', title:'登入次数', width: 100, sort: true, totalRow: '{{ parseInt(d.TOTAL_NUMS) }} 次'}
|
||||
,{field:'joinTime', title:'加入时间', width: 120}
|
||||
,{fixed: 'right', title:'操作', toolbar: '#barDemo', width:150}
|
||||
,{fixed: 'right', title:'操作', toolbar: '#barDemo', width: 180}
|
||||
]]
|
||||
|
||||
,initSort1: {
|
||||
@@ -231,7 +233,7 @@ layui.use(['table', 'dropdown'], function(){
|
||||
case 'getData':
|
||||
var getData = table.getData(obj.config.id);
|
||||
console.log(getData);
|
||||
layer.alert(JSON.stringify(getData));
|
||||
layer.alert(layui.util.escape(JSON.stringify(getData)));
|
||||
break;
|
||||
case 'isAll':
|
||||
layer.msg(checkStatus.isAll ? '全选': '未全选')
|
||||
|
||||
50
examples/text.md.html
Normal file
50
examples/text.md.html
Normal file
@@ -0,0 +1,50 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>text for markdown - layui</title>
|
||||
<link rel="stylesheet" href="../src/css/layui.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-container layui-row">
|
||||
<div class="layui-col-md4 layui-text">
|
||||
<h1>标题1</h1>
|
||||
<h2>标题2</h2>
|
||||
<h3>标题3</h3>
|
||||
<h4>标题4</h4>
|
||||
<h5>标题5</h5>
|
||||
<h6>标题6</h6>
|
||||
<p>段落1段落1段落1段落1段落1段落1段落1段落1段落1段落1段落1段落1段落1段落1段落1段落1 <sup class="footnote-ref"><a href="#ref-1">[1]</a></sup></p>
|
||||
<p>段落2段落2段落2段落2段落2段落2段落2段落2段落2段落2段落2段落2段落2段落2段落2段落2</p>
|
||||
<p>段落3段落3段落3段落3段落3段落3段落3段落3段落3段落3段落3段落3 <a href="">链接</a></p>
|
||||
<ul>
|
||||
<li>无序1</li>
|
||||
<li>无序2</li>
|
||||
<li>无序3</li>
|
||||
</ul>
|
||||
<ol>
|
||||
<li>有序1</li>
|
||||
<li>有序2</li>
|
||||
<li>有序3</li>
|
||||
</ol>
|
||||
<br>
|
||||
<blockquote>
|
||||
<p>引用</p>
|
||||
<blockquote>内嵌引用<blockquote>内嵌引用</blockquote></blockquote>
|
||||
</blockquote>
|
||||
|
||||
<br>
|
||||
|
||||
<pre>
|
||||
var cp = function(){
|
||||
return gulp.src('./dist/**/*')
|
||||
.pipe(gulp.dest(dest));
|
||||
};</pre>
|
||||
|
||||
<p id="ref-1">REF-1</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>文件上传模块 - layui</title>
|
||||
<title>上传组件 - layui</title>
|
||||
|
||||
<link rel="stylesheet" href="../src/css/layui.css">
|
||||
|
||||
@@ -89,7 +89,7 @@ hr{margin: 30px 0;}
|
||||
|
||||
绑定原始文件域:<input type="file" name="file" id="test9">
|
||||
|
||||
<script src="../src/layui.js"></script>
|
||||
<script src="../src/layui.js" src1="https://cdn.staticfile.org/layui/2.6.8/layui.js"></script>
|
||||
<script>
|
||||
layui.use(['upload', 'element'], function(){
|
||||
var $ = layui.jquery
|
||||
@@ -123,16 +123,16 @@ layui.use(['upload', 'element'], function(){
|
||||
layer.msg('不允许上传')
|
||||
return false;
|
||||
}
|
||||
,done: function(res){
|
||||
,done: function(res, index){
|
||||
|
||||
//如果上传失败
|
||||
if(res.code > 0){
|
||||
return layer.msg('上传失败');
|
||||
}
|
||||
//上传成功
|
||||
console.log(res);
|
||||
console.log(res, index);
|
||||
}
|
||||
,error: function(){
|
||||
,error: function(index, upload){
|
||||
this.item.html('重选上传');
|
||||
|
||||
//演示失败状态,并实现重传
|
||||
@@ -145,7 +145,7 @@ layui.use(['upload', 'element'], function(){
|
||||
element.progress('demo', '0%');
|
||||
}
|
||||
,progress: function(n, elem, res, index){
|
||||
console.log(n + '%', elem, res); //获取进度百分比
|
||||
console.log(n + '%', elem, res, index); //获取进度百分比
|
||||
element.progress('demo', n + '%'); //可配合 layui 进度条元素使用
|
||||
}
|
||||
});
|
||||
@@ -158,19 +158,25 @@ layui.use(['upload', 'element'], function(){
|
||||
//,size: 2
|
||||
});
|
||||
|
||||
// 演示多图片上传
|
||||
upload.render({
|
||||
elem: '#test2'
|
||||
,url: 'https://httpbin.org/post'
|
||||
,multiple: true
|
||||
,number: 3
|
||||
,accept: 'images'
|
||||
,number: 3 //同时上传的数量
|
||||
,size: 1024
|
||||
,before: function(obj){
|
||||
//预读本地文件示例,不支持ie8
|
||||
obj.preview(function(index, file, result){
|
||||
$('#demo2').append('<img src="'+ result +'" alt="'+ file.name +'" class="layui-upload-img">')
|
||||
});
|
||||
|
||||
//this.files = obj.pushFile();
|
||||
}
|
||||
,done: function(res){
|
||||
,done: function(res, index){
|
||||
//上传完毕
|
||||
//console.log(this.files)
|
||||
}
|
||||
,allDone: function(obj){
|
||||
console.log(obj)
|
||||
@@ -181,7 +187,7 @@ layui.use(['upload', 'element'], function(){
|
||||
var demoListView = $('#demoList');
|
||||
var uploadListIns = upload.render({
|
||||
elem: '#testList'
|
||||
,url: 'http://httpbin.org/post'
|
||||
,url: 'https://httpbin.org/post'
|
||||
,accept: 'file'
|
||||
,multiple: true
|
||||
,number: 3
|
||||
@@ -189,9 +195,8 @@ layui.use(['upload', 'element'], function(){
|
||||
,bindAction: '#testListAction'
|
||||
,choose: function(obj){
|
||||
var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
|
||||
|
||||
//读取本地文件
|
||||
obj.preview(function(index, file, result){
|
||||
obj.preview(function(index, file, result){
|
||||
var tr = $(['<tr id="upload-'+ index +'">'
|
||||
,'<td>'+ file.name +'</td>'
|
||||
,'<td>'+ (file.size/1014).toFixed(1) +'kb</td>'
|
||||
@@ -300,11 +305,11 @@ layui.use(['upload', 'element'], function(){
|
||||
,auto: false
|
||||
//,multiple: true
|
||||
,bindAction: '#test7'
|
||||
,choose1: function(obj){
|
||||
,choose: function(obj){
|
||||
var that = this;
|
||||
obj.preview(function(index, file){
|
||||
console.log(file.name);
|
||||
obj.resetFile(index, file, '123.jpg');
|
||||
//obj.resetFile(index, file, '123.jpg');
|
||||
});
|
||||
}
|
||||
,before: function(){
|
||||
@@ -317,7 +322,7 @@ layui.use(['upload', 'element'], function(){
|
||||
|
||||
upload.render({
|
||||
elem: '#test8'
|
||||
,url: 'http://httpbin.org/post'
|
||||
,url: 'https://httpbin.org/post'
|
||||
,done: function(res){
|
||||
console.log(res);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user