Browse Source

剔除 examples 部分文件多余空格

pull/1422/head
贤心 1 year ago
parent
commit
769d5275e1
  1. 22
      examples/base.html
  2. 30
      examples/dropdown.html
  3. 18
      examples/element.html
  4. 6
      examples/flow.html
  5. 10
      examples/table.html

22
examples/base.html

@ -27,7 +27,7 @@
layui.use(['lay', 'util'], function(){
var lay = layui.lay
,util = layui.util;
//事件
var style = 'color: orange; font-size: 16px;';
util.event('lay-on', {
@ -78,11 +78,11 @@ layui.use(['lay', 'util'], function(){
], 'a')
);
console.log(
'数组成员全为数字',
'数组成员全为数字',
layui.sort([1, 20.5, 19.5, 52, 4.5])
);
console.log(
'数组成员为混合型',
'数组成员为混合型',
layui.sort([1, {a: 32}, 20.5, {a: 6}, 52, 5.5], 'a') //按成员对象的 key 为 a 进行比较
);
}
@ -90,8 +90,8 @@ layui.use(['lay', 'util'], function(){
,type: function(){
console.log('%c> layui.type: ', style);
console.log(
'new RegExp():', layui.type(new RegExp()),
'\nnew Date():', layui.type(new Date()),
'new RegExp():', layui.type(new RegExp()),
'\nnew Date():', layui.type(new Date()),
'\n[]:', layui.type([])
);
}
@ -99,8 +99,8 @@ layui.use(['lay', 'util'], function(){
,isArray: function(){
console.log('%c> layui.isArray: ', style);
console.log(
'[1,6]:', layui.isArray([1,6]),
'\nlay("div"):', layui.isArray(lay('div')),
'[1,6]:', layui.isArray([1,6]),
'\nlay("div"):', layui.isArray(lay('div')),
'\ndocument.querySelectorAll("div"):', layui.isArray(document.querySelectorAll('div')),
'\n{"key": "value"}:', layui.isArray({key: 'value'})
);
@ -110,9 +110,9 @@ layui.use(['lay', 'util'], function(){
console.log('%c> lay.extend: ', style);
console.log(
lay.extend(
{},
{a: 123, c: {ccc: 'ccc'}, arr: [1,3]},
{a: 111, b: 1, c: {bbb: 'bbb'}},
{},
{a: 123, c: {ccc: 'ccc'}, arr: [1,3]},
{a: 111, b: 1, c: {bbb: 'bbb'}},
{a: 222222, arr: [5]}
)
);
@ -121,7 +121,7 @@ layui.use(['lay', 'util'], function(){
);
}
})
});
</script>
</body>

30
examples/dropdown.html

@ -18,17 +18,17 @@
<i class="layui-icon layui-icon-down layui-font-12"></i>
</button>
<button class="layui-btn layui-btn-primary" id="demo2">
按钮下拉
<i class="layui-icon layui-icon-down layui-font-12"></i>
</button>
</div>
<div class="layui-text">
<a href="javascript:;" id="demo3">文字下拉 <i class="layui-icon layui-icon-down"></i></a>
</div>
<div class="layui-bg-gray" style="margin-top: 30px; width: 100%; height: 300px; text-align: center;" id="demo20">
<span class="layui-font-gray" style="position: relative; top:50%;">鼠标右键菜单</span>
</div>
@ -153,9 +153,9 @@ layui.use('dropdown', function(){
,id: ''
}]
}]
,id: 'demo1'
// 触发点击事件的元素范围 --- default: 仅子菜单触发点击事件(默认,可不填); all: 所有父子菜单均触发点击事件
,clickScope: 'all'
@ -164,7 +164,7 @@ layui.use('dropdown', function(){
console.log(obj);
}
});
var inst = dropdown.render({
elem: '#demo2'
// ,show: true
@ -191,7 +191,7 @@ layui.use('dropdown', function(){
}
});
dropdown.render({
elem: '#demo3'
,content: '自定义内容 123 '
@ -199,8 +199,8 @@ layui.use('dropdown', function(){
,align: 'center'
,trigger: 'hover'
});
//右键
dropdown.render({
elem: document//'#demo20' //也可绑定到 document,从而重置整个右键
@ -245,12 +245,12 @@ layui.use('dropdown', function(){
}
}
});
return;
dropdown.render({
elem: document
,content: '123'

18
examples/element.html

@ -135,7 +135,7 @@ body{padding:20px;}
<p>Layui - 原生态模块化前端 UI 组件库</p>
<p>Layui - 原生态模块化前端 UI 组件库</p>
</blockquote>
<blockquote class="layui-elem-quote layui-quote-nm">
<blockquote class="layui-elem-quote layui-quote-nm">
Layui - 原生态模块化前端 UI 组件库
Layui - 原生态模块化前端 UI 组件库
Layui - 原生态模块化前端 UI 组件库
@ -152,25 +152,25 @@ body{padding:20px;}
默认分割线
<hr>
赤色分割线
<hr class="layui-border-red">
橙色分割线
<hr class="layui-border-orange">
墨绿分割线
<hr class="layui-border-green">
青色分割线
<hr class="layui-border-cyan">
蓝色分割线
<hr class="layui-border-blue">
黑色分割线
<hr class="layui-border-black">
灰色分割线
<hr class="layui-border-gray">
@ -182,7 +182,7 @@ body{padding:20px;}
layui.use(['element', 'form'], function(){
var element = layui.element;
element.on('collapse(test)', function(data){
console.log(data);
});

6
examples/flow.html

@ -61,7 +61,7 @@ layui.use('flow', function(){
}, 500);
}
});
flow.load({
elem: '#test2' //流加载容器
//,scrollElem: '.flow-default' //滚动条所在元素,默认document
@ -78,13 +78,13 @@ layui.use('flow', function(){
}, 500);
}
});
//按屏加载图片
flow.lazyimg({
elem: '.demo img'
,scrollElem: '.demo'
});
});
</script>

10
examples/table.html

@ -83,7 +83,7 @@
<th lay-data="{field:'username', width:200}">昵称</th>
<th lay-data="{field:'joinTime', width:150}">加入时间</th>
<th lay-data="{field:'sign'}">签名</th>
</tr>
</tr>
</thead>
<tbody>
<tr>
@ -177,9 +177,9 @@ layui.use('table', function(){
,{title:'操作', align:'center', toolbar: '#barDemo'}
]]
});
//return;
// 直接赋值数据
table.render({
elem: '#test-data'
@ -293,7 +293,7 @@ layui.use('table', function(){
,skin: 'row' //表格风格
,even: true
//,size: 'lg' //尺寸
,page: true //是否显示分页
,limits: [3,5,10]
,limit: 3 //每页默认显示的数量
@ -314,7 +314,7 @@ layui.use('table', function(){
});
var $ = layui.jquery, active = {
parseTable: function(){
table.init('parse-table-demo', {

Loading…
Cancel
Save