From 769d5275e17d06566de5aba06d0867923cbe9eea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Mon, 6 Nov 2023 08:47:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=94=E9=99=A4=20examples=20=E9=83=A8?= =?UTF-8?q?=E5=88=86=E6=96=87=E4=BB=B6=E5=A4=9A=E4=BD=99=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/base.html | 22 +++++++++++----------- examples/dropdown.html | 30 +++++++++++++++--------------- examples/element.html | 18 +++++++++--------- examples/flow.html | 6 +++--- examples/table.html | 10 +++++----- 5 files changed, 43 insertions(+), 43 deletions(-) diff --git a/examples/base.html b/examples/base.html index 33b9db91..6dd6290d 100644 --- a/examples/base.html +++ b/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(){ ); } }) - + }); diff --git a/examples/dropdown.html b/examples/dropdown.html index 9a8a3174..386db7be 100644 --- a/examples/dropdown.html +++ b/examples/dropdown.html @@ -18,17 +18,17 @@ - + - +
文字下拉
- +
鼠标右键菜单
@@ -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' diff --git a/examples/element.html b/examples/element.html index 1a05b387..77488273 100644 --- a/examples/element.html +++ b/examples/element.html @@ -135,7 +135,7 @@ body{padding:20px;}

Layui - 原生态模块化前端 UI 组件库

Layui - 原生态模块化前端 UI 组件库

-
+
Layui - 原生态模块化前端 UI 组件库 Layui - 原生态模块化前端 UI 组件库 Layui - 原生态模块化前端 UI 组件库 @@ -152,25 +152,25 @@ body{padding:20px;} 默认分割线
- + 赤色分割线
- + 橙色分割线
- + 墨绿分割线
- + 青色分割线
- + 蓝色分割线
- + 黑色分割线
- + 灰色分割线
@@ -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); }); diff --git a/examples/flow.html b/examples/flow.html index 6285e2c7..98994638 100644 --- a/examples/flow.html +++ b/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' }); - + }); diff --git a/examples/table.html b/examples/table.html index 4173be98..01251f5d 100644 --- a/examples/table.html +++ b/examples/table.html @@ -83,7 +83,7 @@ 昵称 加入时间 签名 - + @@ -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', {