From 2d34df644539f96fa12d6fb154c54876909b4812 Mon Sep 17 00:00:00 2001 From: Blood <33853639+9007967@users.noreply.github.com> Date: Fri, 21 Apr 2023 13:58:55 +0800 Subject: [PATCH 01/22] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E5=9C=A8=E4=B8=8D=E5=90=AF=E7=94=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E7=9A=84=E6=97=B6=E5=80=99=E5=BA=95=E8=BE=B9=E6=A1=86?= =?UTF-8?q?=E7=BC=BA=E5=A4=B1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/table.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/table.js b/src/modules/table.js index 39268a07..4d7df815 100644 --- a/src/modules/table.js +++ b/src/modules/table.js @@ -1668,7 +1668,7 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){ if(!height) return; //减去列头区域的高度 - bodyHeight = parseFloat(height) - (that.layHeader.outerHeight() || 38); //此处的数字常量是为了防止容器处在隐藏区域无法获得高度的问题,暂时只对默认尺寸的表格做支持。 + bodyHeight = parseFloat(height) - (that.layHeader.outerHeight() || 38) - 1; //此处的数字常量是为了防止容器处在隐藏区域无法获得高度的问题,暂时只对默认尺寸的表格做支持。 //减去工具栏的高度 if(options.toolbar){ From fa64521b55a5332c9cf62e668b92cf77e2ca7208 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Fri, 28 Apr 2023 17:17:58 +0800 Subject: [PATCH 02/22] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20LOGO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7cf606c0..712ed042 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

- Layui + Layui

Layui

From a12ebf540a74a0f464e0bfc19c91a8a8c5a56fe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Fri, 28 Apr 2023 17:32:31 +0800 Subject: [PATCH 03/22] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E7=9A=84=E5=A4=B4=E9=83=A8=E5=AF=BC=E8=AF=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/versions.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/versions.md b/docs/versions.md index ded7d093..40d4eb7c 100644 --- a/docs/versions.md +++ b/docs/versions.md @@ -5,6 +5,9 @@ toc: true # 更新日志 +> 导读:📑 Layui 2.8 《升级指南》 · 📑 Layui 新版文档站上线初衷 + +

2.8.1 2023-04-25 From 50cb70a16c6a6cf4860592d8bcdfd9fd3a63c5ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Sat, 29 Apr 2023 23:24:56 +0800 Subject: [PATCH 04/22] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20table=20=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E7=9A=84=E9=94=9A=E7=82=B9=E9=94=99=E8=AF=AF=20#1242?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/table/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/table/index.md b/docs/table/index.md index dba21744..17f12cec 100644 --- a/docs/table/index.md +++ b/docs/table/index.md @@ -105,7 +105,7 @@ layui.use(function(){ - 参数 `filter` : `` 元素对应的 `lay-filter` 属性值 - 参数 `options` : 基础属性配置项。[#详见属性](#options) -该方法用于将已输出在页面中的静态表格内容转换为动态 table 组件。[#参考相关示例](demo-init) +该方法用于将已输出在页面中的静态表格内容转换为动态 table 组件。[#参考相关示例](#demo-init) ```
From e3cd9c902049600817bea3eb3247e3fe8be5cf4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Sun, 30 Apr 2023 01:10:55 +0800 Subject: [PATCH 05/22] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E9=97=B4=E9=9A=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layui.js | 234 ++++++++++++++++++++++++++------------------------- 1 file changed, 118 insertions(+), 116 deletions(-) diff --git a/src/layui.js b/src/layui.js index 03a8dadb..361a9356 100644 --- a/src/layui.js +++ b/src/layui.js @@ -18,10 +18,10 @@ this.v = '2.8.1'; // Layui 版本号 } - //识别预先可能定义的指定全局对象 + // 识别预先可能定义的指定全局对象 ,GLOBAL = win.LAYUI_GLOBAL || {} - //获取 layui 所在目录 + // 获取 layui 所在目录 ,getPath = function(){ var jsPath = doc.currentScript ? doc.currentScript.src : function(){ var js = doc.scripts @@ -39,7 +39,7 @@ return config.dir = GLOBAL.dir || jsPath.substring(0, jsPath.lastIndexOf('/') + 1); }() - //异常提示 + // 异常提示 ,error = function(msg, type){ type = type || 'log'; win.console && console[type] && console[type]('layui error hint: ' + msg); @@ -47,38 +47,38 @@ ,isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]' - //内置模块 + // 内置模块 ,modules = config.builtin = { - lay: 'lay' //基础 DOM 操作 - ,layer: 'layer' //弹层 - ,laydate: 'laydate' //日期 - ,laypage: 'laypage' //分页 - ,laytpl: 'laytpl' //模板引擎 - ,form: 'form' //表单集 - ,upload: 'upload' //上传 - ,dropdown: 'dropdown' //下拉菜单 - ,transfer: 'transfer' //穿梭框 - ,tree: 'tree' //树结构 - ,table: 'table' //表格 - ,treeTable: 'treeTable' //树表 - ,element: 'element' //常用元素操作 - ,rate: 'rate' //评分组件 - ,colorpicker: 'colorpicker' //颜色选择器 - ,slider: 'slider' //滑块 - ,carousel: 'carousel' //轮播 - ,flow: 'flow' //流加载 - ,util: 'util' //工具块 - ,code: 'code' //代码修饰器 - ,jquery: 'jquery' //DOM 库(第三方) + lay: 'lay' // 基础 DOM 操作 + ,layer: 'layer' // 弹层 + ,laydate: 'laydate' // 日期 + ,laypage: 'laypage' // 分页 + ,laytpl: 'laytpl' // 模板引擎 + ,form: 'form' // 表单集 + ,upload: 'upload' // 上传 + ,dropdown: 'dropdown' // 下拉菜单 + ,transfer: 'transfer' // 穿梭框 + ,tree: 'tree' // 树结构 + ,table: 'table' // 表格 + ,treeTable: 'treeTable' // 树表 + ,element: 'element' // 常用元素操作 + ,rate: 'rate' // 评分组件 + ,colorpicker: 'colorpicker' // 颜色选择器 + ,slider: 'slider' // 滑块 + ,carousel: 'carousel' // 轮播 + ,flow: 'flow' // 流加载 + ,util: 'util' // 工具块 + ,code: 'code' // 代码修饰器 + ,jquery: 'jquery' // DOM 库(第三方) ,all: 'all' - ,'layui.all': 'layui.all' //聚合标识(功能性的,非真实模块) + ,'layui.all': 'layui.all' // 聚合标识(功能性的,非真实模块) }; - //记录基础数据 + // 记录基础数据 Layui.prototype.cache = config; - //定义模块 + // 定义模块 Layui.prototype.define = function(deps, factory){ var that = this ,type = typeof deps === 'function' @@ -105,7 +105,7 @@ return that; }; - //使用特定模块 + // 使用特定模块 Layui.prototype.use = function(apps, callback, exports, from){ var that = this ,dir = config.dir = config.dir ? config.dir : getPath @@ -115,7 +115,7 @@ if(typeof apps === 'string'){ return [apps]; } - //当第一个参数为 function 时,则自动加载所有内置模块,且执行的回调即为该 function 参数; + // 当第一个参数为 function 时,则自动加载所有内置模块,且执行的回调即为该 function 参数; else if(typeof apps === 'function'){ callback = apps; return ['all']; @@ -123,7 +123,7 @@ return apps; }(); - //如果页面已经存在 jQuery 1.7+ 库且所定义的模块依赖 jQuery,则不加载内部 jquery 模块 + // 如果页面已经存在 jQuery 1.7+ 库且所定义的模块依赖 jQuery,则不加载内部 jquery 模块 if(win.jQuery && jQuery.fn.on){ that.each(apps, function(index, item){ if(item === 'jquery'){ @@ -137,10 +137,10 @@ ,timeout = 0; exports = exports || []; - //静态资源host + // 静态资源host config.host = config.host || (dir.match(/\/\/([\s\S]+?)\//)||['//'+ location.host +'/'])[0]; - //加载完毕 + // 加载完毕 function onScriptLoad(e, url){ var readyRegExp = navigator.platform === 'PLaySTATION 3' ? /^complete$/ : /^(complete|loaded)$/ if (e.type === 'load' || (readyRegExp.test((e.currentTarget || e.srcElement).readyState))) { @@ -155,13 +155,13 @@ } } - //回调 + // 回调 function onCallback(){ exports.push(layui[item]); apps.length > 1 ? that.use(apps.slice(1), callback, exports, from) : ( typeof callback === 'function' && function(){ - //保证文档加载完毕再执行回调 + // 保证文档加载完毕再执行回调 if(layui.jquery && typeof layui.jquery === 'function' && from !== 'define'){ return layui.jquery(function(){ callback.apply(layui, exports); @@ -171,28 +171,30 @@ }() ); } - //如果引入了聚合板,内置的模块则不必重复加载 + // 如果引入了聚合板,内置的模块则不必重复加载 if( apps.length === 0 || (layui['layui.all'] && modules[item]) ){ return onCallback(), that; } - //获取加载的模块 URL - //如果是内置模块,则按照 dir 参数拼接模块路径 - //如果是扩展模块,则判断模块路径值是否为 {/} 开头, - //如果路径值是 {/} 开头,则模块路径即为后面紧跟的字符。 - //否则,则按照 base 参数拼接模块路径 + /* + * 获取加载的模块 URL + * 如果是内置模块,则按照 dir 参数拼接模块路径 + * 如果是扩展模块,则判断模块路径值是否为 {/} 开头, + * 如果路径值是 {/} 开头,则模块路径即为后面紧跟的字符。 + * 否则,则按照 base 参数拼接模块路径 + */ var url = ( modules[item] ? (dir + 'modules/') : (/^\{\/\}/.test(that.modules[item]) ? '' : (config.base || '')) ) + (that.modules[item] || item) + '.js'; url = url.replace(/^\{\/\}/, ''); - //如果扩展模块(即:非内置模块)对象已经存在,则不必再加载 + // 如果扩展模块(即:非内置模块)对象已经存在,则不必再加载 if(!config.modules[item] && layui[item]){ - config.modules[item] = url; //并记录起该扩展模块的 url + config.modules[item] = url; // 并记录起该扩展模块的 url } - //首次加载模块 + // 首次加载模块 if(!config.modules[item]){ var node = doc.createElement('script'); @@ -218,7 +220,7 @@ } config.modules[item] = url; - } else { //缓存 + } else { // 缓存 (function poll() { if(++timeout > config.timeout * 1000 / 4){ return error(item + ' is not a valid module', 'error'); @@ -238,7 +240,7 @@ apps = that.isArray(apps) ? apps : [apps]; that.each(apps, function (index, item) { if (!config.status[item]) { - //return error('module ' + item + ' is not exist'); + // return error('module ' + item + ' is not exist'); } delete that[item]; delete modules[item]; @@ -249,13 +251,13 @@ return that; }; - //获取节点的 style 属性值 + // 获取节点的 style 属性值 Layui.prototype.getStyle = function(node, name){ var style = node.currentStyle ? node.currentStyle : win.getComputedStyle(node, null); return style[style.getPropertyValue ? 'getPropertyValue' : 'getAttribute'](name); }; - //css外部加载器 + // css 外部加载器 Layui.prototype.link = function(href, fn, cssname){ var that = this ,head = doc.getElementsByTagName('head')[0] @@ -278,21 +280,21 @@ if(typeof fn !== 'function') return that; - //轮询 css 是否加载完毕 + // 轮询 css 是否加载完毕 (function poll(status) { var delay = 100 - ,getLinkElem = doc.getElementById(id); //获取动态插入的 link 元素 + ,getLinkElem = doc.getElementById(id); // 获取动态插入的 link 元素 - //如果轮询超过指定秒数,则视为请求文件失败或 css 文件不符合规范 + // 如果轮询超过指定秒数,则视为请求文件失败或 css 文件不符合规范 if(++timeout > config.timeout * 1000 / delay){ return error(href + ' timeout'); } - //css 加载就绪 + // css 加载就绪 if(parseInt(that.getStyle(getLinkElem, 'width')) === 1989){ - //如果参数来自于初始轮询(即未加载就绪时的),则移除 link 标签状态 + // 如果参数来自于初始轮询(即未加载就绪时的),则移除 link 标签状态 if(status === STAUTS_NAME) getLinkElem.removeAttribute('lay-status'); - //如果 link 标签的状态仍为「创建中」,则继续进入轮询,直到状态改变,则执行回调 + // 如果 link 标签的状态仍为「创建中」,则继续进入轮询,直到状态改变,则执行回调 getLinkElem.getAttribute('lay-status') === STAUTS_NAME ? setTimeout(poll, delay) : fn(); } else { getLinkElem.setAttribute('lay-status', STAUTS_NAME); @@ -302,7 +304,7 @@ } }()); - //轮询css是否加载完毕 + // 轮询css是否加载完毕 /* (function poll() { if(++timeout > config.timeout * 1000 / 100){ @@ -317,15 +319,15 @@ return that; }; - //css 内部加载器 + // css 内部加载器 Layui.prototype.addcss = function(firename, fn, cssname){ return layui.link(config.dir + 'css/' + firename, fn, cssname); }; - //存储模块的回调 + // 存储模块的回调 config.callback = {}; - //重新执行模块的工厂函数 + // 重新执行模块的工厂函数 Layui.prototype.factory = function(modName){ if(layui[modName]){ return typeof config.callback[modName] === 'function' @@ -334,7 +336,7 @@ } }; - //图片预加载 + // 图片预加载 Layui.prototype.img = function(url, callback, error) { var img = new Image(); img.src = url; @@ -351,7 +353,7 @@ }; }; - //全局配置 + // 全局配置 Layui.prototype.config = function(options){ options = options || {}; for(var key in options){ @@ -360,7 +362,7 @@ return this; }; - //记录全部模块 + // 记录全部模块 Layui.prototype.modules = function(){ var clone = {}; for(var o in modules){ @@ -369,11 +371,11 @@ return clone; }(); - //拓展模块 + // 拓展模块 Layui.prototype.extend = function(options){ var that = this; - //验证模块是否被占用 + // 验证模块是否被占用 options = options || {}; for(var o in options){ if(that[o] || that.modules[o]){ @@ -396,12 +398,12 @@ ,hash: (hash.match(/[^#](#.*$)/) || [])[1] || '' }; - if(!/^#\//.test(hash)) return data; //禁止非路由规范 + if(!/^#\//.test(hash)) return data; // 禁止非路由规范 hash = hash.replace(/^#\//, ''); data.href = '/' + hash; hash = hash.replace(/([^#])(#.*$)/, '$1').split('/') || []; - //提取 Hash 结构 + // 提取 Hash 结构 that.each(hash, function(index, item){ /^\w+=/.test(item) ? function(){ item = item.split('='); @@ -412,11 +414,11 @@ return data; }; - //URL 解析 + // URL 解析 Layui.prototype.url = function(href){ var that = this ,data = { - //提取 url 路径 + // 提取 url 路径 pathname: function(){ var pathname = href ? function(){ @@ -427,7 +429,7 @@ return pathname.replace(/^\//, '').split('/'); }() - //提取 url 参数 + // 提取 url 参数 ,search: function(){ var obj = {} ,search = (href @@ -436,12 +438,12 @@ return str.replace(/\#.+/, ''); }() : location.search - ).replace(/^\?+/, '').split('&'); //去除 ?,按 & 分割参数 + ).replace(/^\?+/, '').split('&'); // 去除 ?,按 & 分割参数 - //遍历分割后的参数 + // 遍历分割后的参数 that.each(search, function(index, item){ var _index = item.indexOf('=') - ,key = function(){ //提取 key + ,key = function(){ // 提取 key if(_index < 0){ return item.substr(0, item.length); } else if(_index === 0){ @@ -450,7 +452,7 @@ return item.substr(0, _index); } }(); - //提取 value + // 提取 value if(key){ obj[key] = _index > 0 ? item.substr(_index + 1) : null; } @@ -459,7 +461,7 @@ return obj; }() - //提取 Hash + // 提取 Hash ,hash: that.router(function(){ return href ? ((href.match(/#.+/) || [])[0] || '/') @@ -504,20 +506,20 @@ return this.data(table, settings, sessionStorage); } - //设备信息 + // 设备信息 Layui.prototype.device = function(key){ var agent = navigator.userAgent.toLowerCase() - //获取版本号 + // 获取版本号 ,getVersion = function(label){ var exp = new RegExp(label + '/([^\\s\\_\\-]+)'); label = (agent.match(exp)||[])[1]; return label || false; } - //返回结果集 + // 返回结果集 ,result = { - os: function(){ //底层操作系统 + os: function(){ // 底层操作系统 if(/windows/.test(agent)){ return 'windows'; } else if(/linux/.test(agent)){ @@ -528,20 +530,20 @@ return 'mac'; } }() - ,ie: function(){ //ie版本 + ,ie: function(){ // ie 版本 return (!!win.ActiveXObject || "ActiveXObject" in win) ? ( - (agent.match(/msie\s(\d+)/) || [])[1] || '11' //由于ie11并没有msie的标识 + (agent.match(/msie\s(\d+)/) || [])[1] || '11' // 由于 ie11 并没有 msie 的标识 ) : false; }() - ,weixin: getVersion('micromessenger') //是否微信 + ,weixin: getVersion('micromessenger') // 是否微信 }; - //任意的key + // 任意的 key if(key && !result[key]){ result[key] = getVersion(key); } - //移动设备 + // 移动设备 result.android = /android/.test(agent); result.ios = result.os === 'ios'; result.mobile = (result.android || result.ios) ? true : false; @@ -549,32 +551,32 @@ return result; }; - //提示 + // 提示 Layui.prototype.hint = function(){ return { error: error }; }; - //typeof 类型细分 -> string/number/boolean/undefined/null、object/array/function/… + // typeof 类型细分 -> string/number/boolean/undefined/null、object/array/function/… Layui.prototype._typeof = Layui.prototype.type = function(operand){ if(operand === null) return String(operand); - //细分引用类型 + // 细分引用类型 return (typeof operand === 'object' || typeof operand === 'function') ? function(){ - var type = Object.prototype.toString.call(operand).match(/\s(.+)\]$/) || [] //匹配类型字符 - ,classType = 'Function|Array|Date|RegExp|Object|Error|Symbol'; //常见类型字符 + var type = Object.prototype.toString.call(operand).match(/\s(.+)\]$/) || [] // 匹配类型字符 + ,classType = 'Function|Array|Date|RegExp|Object|Error|Symbol'; // 常见类型字符 type = type[1] || 'Object'; - //除匹配到的类型外,其他对象均返回 object + // 除匹配到的类型外,其他对象均返回 object return new RegExp('\\b('+ classType + ')\\b').test(type) ? type.toLowerCase() : 'object'; }() : typeof operand; }; - //对象是否具备数组结构(此处为兼容 jQuery 对象) + // 对象是否具备数组结构(此处为兼容 jQuery 对象) Layui.prototype._isArray = Layui.prototype.isArray = function(obj){ var that = this ,len @@ -582,24 +584,24 @@ if(!obj || (typeof obj !== 'object') || obj === win) return false; - len = 'length' in obj && obj.length; //兼容 ie + len = 'length' in obj && obj.length; // 兼容 ie return type === 'array' || len === 0 || ( - typeof len === 'number' && len > 0 && (len - 1) in obj //兼容 jQuery 对象 + typeof len === 'number' && len > 0 && (len - 1) in obj // 兼容 jQuery 对象 ); }; - //遍历 + // 遍历 Layui.prototype.each = function(obj, fn){ var key ,that = this - ,callFn = function(key, obj){ //回调 + ,callFn = function(key, obj){ // 回调 return fn.call(obj[key], key, obj[key]) }; if(typeof fn !== 'function') return that; obj = obj || []; - //优先处理数组结构 + // 优先处理数组结构 if(that.isArray(obj)){ for(key = 0; key < obj.length; key++){ if(callFn(key, obj)) break; @@ -623,7 +625,7 @@ // 若未传入 key,则直接返回原对象 if(that.type(arr) === 'object' && !key){ return clone; - } else if(typeof arr !== 'object'){ //若 arr 非对象 + } else if(typeof arr !== 'object'){ // 若 arr 非对象 return [clone]; } @@ -665,11 +667,11 @@ // 若为数字比较 if(isNum[0] && isNum[1]){ - if(v1 && (!v2 && v2 !== 0)){ //数字 vs 空 + if(v1 && (!v2 && v2 !== 0)){ // 数字 vs 空 return 1; - } else if((!v1 && v1 !== 0) && v2){ //空 vs 数字 + } else if((!v1 && v1 !== 0) && v2){ // 空 vs 数字 return -1; - } else { //数字 vs 数字 + } else { // 数字 vs 数字 return v1 - v2; } } @@ -691,9 +693,9 @@ } // 若为混合比较 - if(isNum[0] || !isNum[1]){ //数字 vs 非数字 + if(isNum[0] || !isNum[1]){ // 数字 vs 非数字 return -1; - } else if(!isNum[0] || isNum[1]) { //非数字 vs 数字 + } else if(!isNum[0] || isNum[1]) { // 非数字 vs 数字 return 1; } @@ -703,7 +705,7 @@ return clone; }; - //阻止事件冒泡 + // 阻止事件冒泡 Layui.prototype.stope = function(thisEvent){ thisEvent = thisEvent || win.event; try { thisEvent.stopPropagation() } catch(e){ @@ -711,10 +713,10 @@ } }; - //字符常理 + // 字符常理 var EV_REMOVE = 'LAYUI-EVENT-REMOVE'; - //自定义模块事件 + // 自定义模块事件 Layui.prototype.onevent = function(modName, events, callback){ if(typeof modName !== 'string' || typeof callback !== 'function') return this; @@ -722,25 +724,25 @@ return Layui.event(modName, events, null, callback); }; - //执行自定义模块事件 + // 执行自定义模块事件 Layui.prototype.event = Layui.event = function(modName, events, params, fn){ var that = this ,result = null - ,filter = (events || '').match(/\((.*)\)$/)||[] //提取事件过滤器字符结构,如:select(xxx) - ,eventName = (modName + '.'+ events).replace(filter[0], '') //获取事件名称,如:form.select - ,filterName = filter[1] || '' //获取过滤器名称,,如:xxx + ,filter = (events || '').match(/\((.*)\)$/)||[] // 提取事件过滤器字符结构,如:select(xxx) + ,eventName = (modName + '.'+ events).replace(filter[0], '') // 获取事件名称,如:form.select + ,filterName = filter[1] || '' // 获取过滤器名称,,如:xxx ,callback = function(_, item){ var res = item && item.call(that, params); res === false && result === null && (result = false); }; - //如果参数传入特定字符,则执行移除事件 + // 如果参数传入特定字符,则执行移除事件 if(params === EV_REMOVE){ delete (that.cache.event[eventName] || {})[filterName]; return that; } - //添加事件 + // 添加事件 if(fn){ config.event[eventName] = config.event[eventName] || {}; @@ -755,15 +757,15 @@ return this; } - //执行事件回调 + // 执行事件回调 layui.each(config.event[eventName], function(key, item){ - //执行当前模块的全部事件 + // 执行当前模块的全部事件 if(filterName === '{*}'){ layui.each(item, callback); return; } - //执行指定事件 + // 执行指定事件 key === '' && layui.each(item, callback); (filterName && key === filterName) && layui.each(item, callback); }); @@ -771,20 +773,20 @@ return result; }; - //新增模块事件 + // 新增模块事件 Layui.prototype.on = function(events, modName, callback){ var that = this; return that.onevent.call(that, modName, events, callback); } - //移除模块事件 + // 移除模块事件 Layui.prototype.off = function(events, modName){ var that = this; return that.event.call(that, modName, events, EV_REMOVE); }; - //exports layui + // exports layui win.layui = new Layui(); -}(window); //gulp build: layui-footer +}(window); // gulp build: layui-footer From b6fc5e898541e2bf48ddee9df0a6ad826506d5c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Sun, 30 Apr 2023 01:11:44 +0800 Subject: [PATCH 06/22] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=B3=A8=E9=87=8A=E5=AD=97=E7=AC=A6=E9=97=B4=E9=9A=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/lay.js | 4 ++-- src/modules/laydate.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/lay.js b/src/modules/lay.js index 354f4cb2..f597a6c2 100644 --- a/src/modules/lay.js +++ b/src/modules/lay.js @@ -1,7 +1,7 @@ /** lay 基础模块 | MIT Licensed */ -;!function(window){ //gulp build: lay-header +;!function(window){ // gulp build: lay-header "use strict"; var MOD_NAME = 'lay' //模块名 @@ -433,4 +433,4 @@ }); } -}(window, window.document); //gulp build: lay-footer \ No newline at end of file +}(window, window.document); // gulp build: lay-footer \ No newline at end of file diff --git a/src/modules/laydate.js b/src/modules/laydate.js index 5eca1687..3bf30cb8 100644 --- a/src/modules/laydate.js +++ b/src/modules/laydate.js @@ -1,6 +1,6 @@ /** laydate 日期与时间控件 | MIT Licensed */ -;!function(window, document){ //gulp build: laydate-header +;!function(window, document){ // gulp build: laydate-header "use strict"; var isLayui = window.layui && layui.define, ready = { From 1c6560afa195f6b5c53e21dd9546d768e2f1b262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Sun, 30 Apr 2023 01:12:43 +0800 Subject: [PATCH 07/22] =?UTF-8?q?=E7=BB=86=E8=B0=83=20task=20=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E7=9A=84=E6=96=87=E5=AD=97=E9=97=B4=E8=B7=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gulpfile.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 64663816..f663678b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -136,11 +136,11 @@ exports.laydate = () => { // gulp laydate // js return gulp.src(['./src/layui.js', './src/modules/{lay,laydate}.js']) .pipe(replace('win.layui =', 'var layui =')) // 将 layui 替换为局部变量 - .pipe(replace('}(window); //gulp build: layui-footer', '')) // 替换 layui.js 的落脚 - .pipe(replace(';!function(window){ //gulp build: lay-header', '')) // 替换 lay.js 的头部 - .pipe(replace('}(window, window.document); //gulp build: lay-footer', '')) // 替换 lay.js 的落脚 + .pipe(replace('}(window); // gulp build: layui-footer', '')) // 替换 layui.js 的落脚 + .pipe(replace(';!function(window){ // gulp build: lay-header', '')) // 替换 lay.js 的头部 + .pipe(replace('}(window, window.document); // gulp build: lay-footer', '')) // 替换 lay.js 的落脚 .pipe(concat('laydate.js', {newLine: ''})) - .pipe(replace(';!function(window, document){ //gulp build: laydate-header', '')) // 替换 laydate.js 的头部 + .pipe(replace(';!function(window, document){ // gulp build: laydate-header', '')) // 替换 laydate.js 的头部 .pipe(header.apply(null, comment)) // 追加头部 .pipe(gulp.dest(dest + 'src')); }; From c72e6aef99390927c0895d41c60464a97e7b93df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Sun, 30 Apr 2023 09:23:24 +0800 Subject: [PATCH 08/22] =?UTF-8?q?=E4=BC=98=E5=8C=96=20button=20=E5=AE=B9?= =?UTF-8?q?=E5=99=A8=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/css/layui.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/css/layui.css b/src/css/layui.css index 2f3df254..b5b3782a 100644 --- a/src/css/layui.css +++ b/src/css/layui.css @@ -682,7 +682,7 @@ a cite{font-style: normal; *cursor:pointer;} /* 按钮容器 */ .layui-btn-container{word-spacing: -5px;} -.layui-btn-container .layui-btn{margin-right: 10px; margin-bottom: 10px;} +.layui-btn-container .layui-btn{margin-right: 10px; margin-bottom: 10px; word-spacing: normal;} .layui-btn-container .layui-btn+.layui-btn{margin-left: 0;} .layui-table .layui-btn-container .layui-btn{margin-bottom: 9px;} From e8d2a6728be586a5e85d27e57b6d10168902f984 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Sun, 30 Apr 2023 09:24:00 +0800 Subject: [PATCH 09/22] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20LOGO=20=E9=93=BE?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 712ed042..c5ef4e2b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

- + Layui

From 510bc1ada8ab83f1b1ecb26e3be45de5d6015842 Mon Sep 17 00:00:00 2001 From: sight <1453017105@qq.com> Date: Wed, 3 May 2023 14:21:54 +0800 Subject: [PATCH 10/22] =?UTF-8?q?treeTable=20=E6=96=87=E6=A1=A3=20`rootIid?= =?UTF-8?q?`=20->=20`rootId`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/treeTable/detail/options.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/treeTable/detail/options.md b/docs/treeTable/detail/options.md index 28032243..01403779 100644 --- a/docs/treeTable/detail/options.md +++ b/docs/treeTable/detail/options.md @@ -59,7 +59,7 @@ treeTable.render({ | name | 自定义「节点」属性名 | string | `name` | | id | 自定义「节点索引」属性名 | string | `id` | | pid | 自定义「父节点索引」属性名 | string | `pid` | -| rootIid | 自定义「根节点索引」属性名 | string | - | +| rootId | 自定义「根节点索引」属性名 | string | - | From 40b3f33db0814572950c43a5356712d1b468e0a3 Mon Sep 17 00:00:00 2001 From: sight <1453017105@qq.com> Date: Wed, 3 May 2023 14:36:46 +0800 Subject: [PATCH 11/22] =?UTF-8?q?laydate=20=E6=96=87=E6=A1=A3=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=20`circle`=20=E4=B8=BB=E9=A2=98=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/laydate/examples/theme.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/laydate/examples/theme.md b/docs/laydate/examples/theme.md index 3c4b48a5..5f722a8a 100644 --- a/docs/laydate/examples/theme.md +++ b/docs/laydate/examples/theme.md @@ -18,6 +18,12 @@ +
+ +
+ +
+
@@ -49,6 +55,12 @@ layui.use(function(){ theme: 'grid' }); + // 圆圈高亮主题 + laydate.render({ + elem: 'ID-laydate-theme-circle', + theme: 'circle' // 2.8+新增主题 + }); + // 混合主题 laydate.render({ elem: '#ID-laydate-theme-multi', From f3b05a34b1f7024bc083c4d13f8349125643c913 Mon Sep 17 00:00:00 2001 From: sight <1453017105@qq.com> Date: Wed, 3 May 2023 15:12:42 +0800 Subject: [PATCH 12/22] =?UTF-8?q?laydate=20=E6=96=87=E6=A1=A3=E7=BB=86?= =?UTF-8?q?=E8=8A=82=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/laydate/detail/options.md | 8 +++++--- docs/laydate/index.md | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/laydate/detail/options.md b/docs/laydate/detail/options.md index 1acb4b28..1aa58fa6 100644 --- a/docs/laydate/detail/options.md +++ b/docs/laydate/detail/options.md @@ -89,7 +89,7 @@ range: ['#start', '#end']
@@ -356,7 +356,7 @@ max: 7 // 最大日期为 7 天后 @@ -465,7 +465,7 @@ btns: ['clear', 'confirm']
-设置组件面板主题。除了默认主题,还内置主题: `molv` `grid` ,且支持直接传入自定义的主题色。 +设置组件面板主题。除了默认主题,还内置主题: `molv` `grid` `circle`2.8+ ,且支持直接传入自定义的主题色。
@@ -508,7 +508,9 @@ theme: ['grid', '#FF5722'] @@ -121,8 +121,8 @@ treeTable.render({ | type | 请求的接口类型,设置可缺省同上 | string | - | | contentType | 提交参数的数据类型,设置可缺省同上 | string | - | | headers | 提交请求头,设置可缺省同上 | object | - | -| where | 提交参数的数据,设置可缺省同 | object | - | -| autoParam | 自动参数,可以根据配置项以及当前节点的数据传参,如: `['type', 'age=age', 'pId=id']` ,那么其请求参数将包含: `{type: '父节点 type', age: '父节点 age', pId: '父节点 id'}` | array | - | +| where | 提交参数的数据,设置可缺省同上 | object | - | +| autoParam | 自动参数,可以根据配置项以及当前节点的数据传参,如: `['type', 'age=age', 'parentId=id']` ,那么其请求参数将包含: `{type: '父节点 type', age: '父节点 age', parentId: '父节点 id'}` | array | - | diff --git a/docs/treeTable/index.md b/docs/treeTable/index.md index 04fe4d53..2dd98ca3 100644 --- a/docs/treeTable/index.md +++ b/docs/treeTable/index.md @@ -200,7 +200,7 @@ treeTable.addNodes('test', { | inherit | 子节点是否继承父节点的展开或关闭状态,`expandFlag` 属性必须为 `boolean` 型时才有效。 | boolean | `false` | | callbackFlag | 是否触发事件(`beforeExpand,onExpand`) | boolean | `false` | -若操作的节点不是一个父节点,则返回 `null` ,否则返回操作之后的折叠状态。 +若操作的节点不是一个父节点,则返回 `null`,否则返回操作之后的折叠状态。 ```js // 渲染 From 941fea6e351c89ee77ece5ec75242374cfe9821c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Wed, 3 May 2023 17:14:26 +0800 Subject: [PATCH 17/22] =?UTF-8?q?=E4=BC=98=E5=8C=96=20README=20=E6=96=87?= =?UTF-8?q?=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c5ef4e2b..7eecfcdc 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ Layui 是一套开源免费的 Web UI 组件库,采用自身轻量级模块化 2016年10月14日,Layui 发布了 `1.0.0` 首版,此后多年被广泛应用在不计其数的 Web 平台。 -2021年10月13日,Layui 发布了原官网下线的公告(导读),并将文档站点切换到了 Gitee Pages,社区及日常维护亦全面转移到了 Gitee 和 Github 平台,并顺带呼吁大家拥抱其他更好的主流框架,导致大家误以为 Layui 停更了。事实上,自那以后,Layui 仍然在 Github 和 Gitee 保持活跃,并不存在所谓的停止更新,从当时的 `2.6.8` 一直连续迭代到如今的最新版本。 +2021年10月13日,Layui 发布了原官网下线的公告(导读),并将文档站点切换到了 Gitee Pages,社区及日常维护亦全面转移到了 Gitee 和 Github 平台,以此呼吁大家拥抱其他更好的主流框架,导致大家误以为 Layui 停更了。事实上,自那以后,Layui 仍然在 Github 和 Gitee 保持活跃,并不存在所谓的停止更新,从当时的 `2.6.8` 一直连续迭代到如今的最新版本。 2023年4月24日,Layui 发布了 `2.8.0` 正式版,并上线了[新的文档站点](https://layui.dev),这是一次朴实的回归,更是情怀的延续。 但我们仍然坚持两年前那则公告中的观点, _即仍然推荐大家去拥抱主流,始终保持对前沿技术的无限热爱,是开发者们都应具备的思维属性_。 **而 Layui 所做的,是为填补主流之外的那些略显狭小的空隙**。Layui 虽不是前端主流,但也早已不是作者个人的 Layui,而是所有仍在坚持使用它的人的 Layui,它仍然支撑着许多项目,也代表着许多人的工作。作为开源创作者,应该要为这些坚持者而守望。 From 727fb8305e64e812e924493a6d034fd669cdc076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Wed, 3 May 2023 17:17:39 +0800 Subject: [PATCH 18/22] =?UTF-8?q?=E4=BC=98=E5=8C=96=20Docs=20=E5=86=85?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/.layui/DOCS_TEMPLATE.md | 34 ------------------------ docs/.layui/DOCS_TEMPLATE_DEMO.md | 27 ------------------- docs/.layui/DOCS_TEMPLATE_OPTIONS.md | 32 ---------------------- docs/@note/2.8/news.md | 21 ++++++++++++--- docs/@note/2.8/upgrade-guide.md | 14 ++++++++-- docs/README.md | 22 ++++++++++++++- docs/anim/index.md | 4 ++- docs/carousel/detail/demo.md | 5 +++- docs/code/index.md | 3 ++- docs/colorpicker/detail/demo.md | 16 +++++++++++ docs/colorpicker/index.md | 3 ++- docs/dropdown/examples/align.md | 1 + docs/dropdown/examples/base.md | 1 + docs/dropdown/examples/complex.md | 1 + docs/dropdown/examples/content.md | 3 ++- docs/dropdown/examples/contextmenu.md | 1 + docs/dropdown/examples/on.md | 1 + docs/dropdown/examples/reload.md | 1 + docs/dropdown/examples/reloadData.md | 1 + docs/dropdown/examples/table.md | 1 + docs/dropdown/index.md | 3 ++- docs/flow/detail/demo.md | 4 +++ docs/flow/index.md | 2 ++ docs/form/checkbox.md | 1 + docs/form/examples/form.demo.md | 1 + docs/form/examples/form.grid.md | 3 ++- docs/form/examples/form.login.md | 1 + docs/form/examples/form.pane.md | 3 ++- docs/form/examples/form.reg.md | 3 ++- docs/form/examples/form.val.md | 1 + docs/form/examples/form.validate.md | 3 ++- docs/form/examples/form.verify.md | 3 ++- docs/form/examples/input.affix.custom.md | 1 + docs/form/index.md | 4 +++ docs/form/radio.md | 1 + docs/form/select.md | 1 + docs/index.md | 3 ++- docs/laydate/examples/elem.md | 1 + docs/laydate/examples/format.md | 1 + docs/laydate/examples/limit.md | 1 + docs/laydate/examples/mark.md | 1 + docs/laydate/examples/more.md | 1 + docs/laydate/examples/normal.md | 1 + docs/laydate/examples/range.md | 1 + docs/laydate/examples/shortcut.md | 1 + docs/laydate/examples/static.md | 1 + docs/laydate/examples/theme.md | 1 + docs/laydate/examples/type.md | 1 + docs/laydate/index.md | 1 + docs/layer/examples/alert.md | 1 + docs/layer/examples/direction.md | 1 + docs/layer/examples/iframe.md | 1 + docs/layer/examples/load.md | 1 + docs/layer/examples/more.md | 1 + docs/layer/examples/offset.md | 1 + docs/layer/examples/other.md | 1 + docs/layer/examples/page.md | 1 + docs/layer/examples/skin.md | 1 + docs/layer/examples/tips.md | 1 + docs/layer/examples/type.md | 1 + docs/layer/index.md | 1 + docs/layout/index.md | 1 + docs/laypage/detail/demo.md | 20 ++++++++++++++ docs/laytpl/index.md | 1 + docs/nav/examples/side.md | 1 + docs/nav/index.md | 4 +++ docs/panel/index.md | 1 + docs/progress/index.md | 5 +++- docs/rate/detail/demo.md | 13 +++++++++ docs/rate/index.md | 1 + docs/slider/detail/demo.md | 20 ++++++++++++++ docs/slider/index.md | 1 + docs/tab/detail/demo.md | 8 ++++-- docs/tab/index.md | 5 ++++ docs/table/examples/autoRender.md | 4 ++- docs/table/examples/data.md | 3 ++- docs/table/examples/editModes.md | 3 ++- docs/table/examples/editable.md | 3 ++- docs/table/examples/filter.md | 3 ++- docs/table/examples/init.md | 3 ++- docs/table/examples/onrowContextmenu.md | 1 + docs/table/examples/page.md | 3 ++- docs/table/examples/parse.md | 1 + docs/table/examples/search.md | 3 ++- docs/table/examples/setRowChecked.md | 1 + docs/table/examples/templet.md | 3 ++- docs/table/examples/theads.md | 4 ++- docs/table/index.md | 8 ++++-- docs/transfer/detail/demo.md | 14 ++++++++++ docs/tree/detail/demo.md | 9 +++++++ docs/treeTable/examples/demo.md | 1 + docs/upload/examples/accept.md | 1 + docs/upload/examples/auto.md | 1 + docs/upload/examples/drag.md | 1 + docs/upload/examples/files.table.md | 3 ++- docs/upload/examples/form.file.md | 3 ++- docs/upload/examples/image.md | 3 ++- docs/upload/examples/size.md | 1 + docs/upload/index.md | 1 + docs/util/detail/demo.md | 3 ++- docs/util/index.md | 3 ++- docs/versions.md | 4 +-- 102 files changed, 292 insertions(+), 134 deletions(-) delete mode 100644 docs/.layui/DOCS_TEMPLATE.md delete mode 100644 docs/.layui/DOCS_TEMPLATE_DEMO.md delete mode 100644 docs/.layui/DOCS_TEMPLATE_OPTIONS.md diff --git a/docs/.layui/DOCS_TEMPLATE.md b/docs/.layui/DOCS_TEMPLATE.md deleted file mode 100644 index cc913bd9..00000000 --- a/docs/.layui/DOCS_TEMPLATE.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: 某某组件 MOD_NAME -toc: true ---- - -# 某某组件 - -> 某某组件 `MOD_NAME` - -

示例

- -
-{{- d.include("docs/MOD_NAME/detail/demo.md") }} -
- -

API

- -| API | 描述 | -| --- | --- | -| var MOD_NAME = layui.MOD_NAME | 获得 `MOD_NAME` 模块。 | -| [MOD_NAME.render(options)](#render) | MOD_NAME 组件渲染,核心方法。 | -| …… | …… | - -

渲染

- -`MOD_NAME.render(options);` - -- 参数 `options` : 基础属性配置项。[#详见属性](#options) - -

属性

- -
-{{- d.include("docs/MOD_NAME/detail/options.md") }} -
\ No newline at end of file diff --git a/docs/.layui/DOCS_TEMPLATE_DEMO.md b/docs/.layui/DOCS_TEMPLATE_DEMO.md deleted file mode 100644 index 7422e072..00000000 --- a/docs/.layui/DOCS_TEMPLATE_DEMO.md +++ /dev/null @@ -1,27 +0,0 @@ -
-  
-
- -

示例标题

- -
-  
-
\ No newline at end of file diff --git a/docs/.layui/DOCS_TEMPLATE_OPTIONS.md b/docs/.layui/DOCS_TEMPLATE_OPTIONS.md deleted file mode 100644 index 2ccee5ab..00000000 --- a/docs/.layui/DOCS_TEMPLATE_OPTIONS.md +++ /dev/null @@ -1,32 +0,0 @@ -
rangeLinked 2.8+ -是否开启日期范围选择时的区间联动标注模式,该必须开启 `range` 属性后生效。日期范围默认采用的是*左右面板独立选择模式*,设置该属性后,将采用*左右面板联动选择模式*。 +是否开启日期范围选择时的区间联动标注模式,该模式必须开启 `range` 属性才能生效。日期范围默认采用的是*左右面板独立选择模式*,设置该属性后,将采用*左右面板联动选择模式*。
效果详见: [#示例](#demo-range)
zIndex -设置组件面板的层叠顺序。一般用于解决与其它元素的互相被遮掩的问题。若 `positio: 'tatic'` 时,则该属性无效。 +设置组件面板的层叠顺序。一般用于解决与其它元素的互相被遮掩的问题。若 `position: 'static'` 时,则该属性无效。 number
+ 自定义日期标记。该属性是对 `calendar` 属性的进一步延伸,灵活度更高。属性可批量设置多个日期标记,如: +
``` diff --git a/docs/laydate/index.md b/docs/laydate/index.md index 4086fd70..245302f2 100644 --- a/docs/laydate/index.md +++ b/docs/laydate/index.md @@ -36,7 +36,7 @@ toc: true | [laydate.getInst(id)](#getInst) 2.8+ | 获取组件对应的渲染实例。 | | [laydate.unbind(id)](#close) 2.8+ | 对目标元素解除当前实例的绑定。 | | [laydate.close(id)](#close) 2.7+ | 关闭日期面板。 | -| [laydate.getEndDate(month, year)](#getEndDate) | 获取某月的最后一天 | +| [laydate.getEndDate(month, year)](#getEndDate) | 获取某月的最后一天。 |

渲染

@@ -105,7 +105,7 @@ laydate.hint('test', { - 参数 `id` : 组件渲染时定义的 `id` 属性值 -该方法用于在获取 laydate 对应 id 的渲染实例,以获得该实例对应的成员属性。 +该方法用于获取 laydate 对应 id 的渲染实例,以获得该实例对应的成员属性。 ``` var laydate = layui.laydate; @@ -127,7 +127,7 @@ console.log(inst); // 实例对象 - 参数 `id` : 组件渲染时定义的 `id` 属性值 -该方法用于对目标元素对应的实例的完全解除,即触发元素事件时,不再执行组件渲染。 +该方法用于对目标元素对应的实例的绑定完全解除,即触发元素事件时,不再执行组件渲染。 ``` var laydate = layui.laydate; From b3f490823b47b264fdd0330631af0cd9b9d1af34 Mon Sep 17 00:00:00 2001 From: sight <1453017105@qq.com> Date: Wed, 3 May 2023 15:54:44 +0800 Subject: [PATCH 13/22] =?UTF-8?q?=E8=A1=A5=E5=85=85=20code=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/versions.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/versions.md b/docs/versions.md index 40d4eb7c..fb77f525 100644 --- a/docs/versions.md +++ b/docs/versions.md @@ -181,12 +181,14 @@ toc: true - 优化 部分代码存在的冗余逻辑 # 1169 - #### code - 新增 `preview` 属性,用于开启 Code 预览功能 - - 新增 `previewStyle/codeStyle` 属性,用于设 Code 区域、预览区域的样式 + - 新增 `style/previewStyle/codeStyle` 属性,用于设 Code 区域、预览区域的样式 - 新增 `text` 属性,用于自定义默认文本 - 新增 `header` 属性,用于是否开启 Code 区域的头部栏 - 新增 `layout` 属性,用于设定开启预览时的标签排列方式 - 新增 `tools` 属性,用于开启头部右侧区域工具栏(内置:全屏) - 新增 `toolsEvent` 属性,用于自定义工具栏事件 + - 新增 `id` 属性,设置实例的唯一索引,以便用于其他操作 + - 新增 `className` 属性,追加实例面板的 className,以便对其自定义样式 - 新增 `done` 属性,即执行 Code 预览后的回调函数 - #### laytpl - 新增 模板局部自定义标签符功能,可在 `laytpl(str, options)` 的第二个参数中设置 From 35a8abf6e01c576f86f9146b3ec5424834bab9b5 Mon Sep 17 00:00:00 2001 From: sight <1453017105@qq.com> Date: Wed, 3 May 2023 16:21:38 +0800 Subject: [PATCH 14/22] =?UTF-8?q?treeTable=20=E6=96=87=E6=A1=A3=20API=20?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E4=B8=AD=E8=BD=AC=E4=B9=89=E8=8B=B1=E6=96=87?= =?UTF-8?q?=E5=8D=8A=E8=A7=92=E5=8D=95=E5=BC=95=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/treeTable/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/treeTable/index.md b/docs/treeTable/index.md index 6aff54ea..04fe4d53 100644 --- a/docs/treeTable/index.md +++ b/docs/treeTable/index.md @@ -36,7 +36,7 @@ toc: true | [treeTable.expandAll(id, expandFlag)](#expandAll) | 展开或关闭全部节点(目前只支持关闭全部)。 | | [treeTable.setRowChecked(id, opts)](#setRowChecked) | 设置行选中状态 | | [treeTable.checkAllNodes(id, checked)](#checkAllNodes) | 全选或取消全选 | -| [treeTable.on('event(filter)', callback)](#on) | treeTable 相关事件 | +| [treeTable.on(\'event(filter)\', callback)](#on) | treeTable 相关事件 |

渲染

From a1cea61df8e90410afe210a7dcbd752f5a3edb6c Mon Sep 17 00:00:00 2001 From: sight <1453017105@qq.com> Date: Wed, 3 May 2023 16:48:59 +0800 Subject: [PATCH 15/22] =?UTF-8?q?table=20=E6=96=87=E6=A1=A3=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E8=A1=A8=E6=A0=BC=E6=B7=BB=E5=8A=A0=20`toolDouble`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/table/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/table/index.md b/docs/table/index.md index 17f12cec..8aab04bc 100644 --- a/docs/table/index.md +++ b/docs/table/index.md @@ -491,7 +491,7 @@ table.hideCol('test', false); // `true` or `false` | [row / rowDouble](#on-row) | 行单击和双击事件 | | [rowContextmenu](#on-rowContextmenu) 2.8+ | 行右键菜单事件 | | [edit](#on-edit) | 单元格编辑事件 | -| [tool](#on-tool) 🔥 | 单元格工具事件。可在该事件中实现行的更新与删除操作。 | +| [tool / toolDouble](#on-tool) 🔥 | 单元格工具事件。可在该事件中实现行的更新与删除操作。 | | [checkbox](#on-checkbox) | 复选框事件 | | [radio](#on-radio) | 单选框事件 | | [pagebar](#on-pagebar) 2.7+ | 尾部分页栏事件 | From edd0f881a0fc121d82957d1570f48a2cd7ca896c Mon Sep 17 00:00:00 2001 From: sight <1453017105@qq.com> Date: Wed, 3 May 2023 17:12:03 +0800 Subject: [PATCH 16/22] =?UTF-8?q?treeTable=20=E6=96=87=E6=A1=A3=20`tree.cu?= =?UTF-8?q?stomName.pid`=20=E9=A2=84=E8=AE=BE=E5=80=BC=E9=94=99=E8=AF=AF?= =?UTF-8?q?=EF=BC=8C`pid`=20->=20`parentId`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/treeTable/detail/options.md | 6 +++--- docs/treeTable/index.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/treeTable/detail/options.md b/docs/treeTable/detail/options.md index 01403779..dfaa89ce 100644 --- a/docs/treeTable/detail/options.md +++ b/docs/treeTable/detail/options.md @@ -58,7 +58,7 @@ treeTable.render({ | isParent | 自定义「是否属于父节点」的属性名 | string | `isParent` | | name | 自定义「节点」属性名 | string | `name` | | id | 自定义「节点索引」属性名 | string | `id` | -| pid | 自定义「父节点索引」属性名 | string | `pid` | +| pid | 自定义「父节点索引」属性名 | string | `parentId` | | rootId | 自定义「根节点索引」属性名 | string | - |
- - - - - - - - - - - - - - - - - - - - - - -
属性名描述类型默认值
AAA - - - -CCC - - - -
\ No newline at end of file diff --git a/docs/@note/2.8/news.md b/docs/@note/2.8/news.md index 4ae89054..7ee232e7 100644 --- a/docs/@note/2.8/news.md +++ b/docs/@note/2.8/news.md @@ -1,21 +1,34 @@ --- -title: 🚀 Layui 2.8.0 正式发布,朴实归来 +title: 🚀 Layui 2.8.0 正式发布,全新文档站朴实归来 toc: false --- -# 🚀 Layui 2.8.0 正式发布,朴实归来 +# 🚀 Layui 2.8.0 正式发布,全新文档站朴实归来 + +

+ 发布:2023-04-24 +

我们终于迎来了 Layui `2.8.0` 的正式版本,以及全新的文档站。 在 Layui 过往七年的开源历程中,从未用多达**二十个预览版**去为一个正式版而引路。 显然,`2.8.0` 是 Layui 一次朴实的回归,更是情怀的延续。但却并不是想以此呼吁人们重新去选择它,我们仍然坚持两年前那则《[Layui 原官网下线公告](https://unpkg.com/outeres@0.0.7/img/layui/notice-2021.png)》中的观点, _即仍然推荐大家去拥抱主流,始终保持对前沿技术的无限热爱,是开发者们都应具备的思维属性_。 **而 Layui 所做的,是为填补主流之外的那些略显狭小的空隙**。 -Layui 虽然并不是前端主流,但也早已不是作者个人的 Layui,而是所有仍在坚持使用它的人的 Layui,它仍然支撑着许多项目,也代表着许多人的工作,作为开源创作者的我们,应该要为这些坚持者而守望。 +Layui 虽不是前端主流,但也早已不是作者个人的 Layui,而是所有仍在坚持使用它的人的 Layui,它仍然支撑着许多项目,也代表着许多人的工作,作为开源创作者的我们,应该要为这些坚持者而守望。 ### 新文档站 -在 2021 年 Layui 原官网下线后,互联网出现了许多第三方的 Layui 文档镜像站点,这在当时,给大家能继续阅读文档确实提供了便利,但原官网的下线,只是单纯一个网站自身生命周期的结束,它并不意味着 Layui 这样一个开源项目的停更,当时的公告其实也说的很清楚了,但或许是由于那则公告的用词过于「悲壮」,使得各大自媒体有所误读,从而让大家都以为是 Layui 停更了。 事实上,自那以后,Layui 仍然在 Github 和 Gitee 保持活跃,并不存在所谓的停止更新,甚至从 `2.6.9` 一直迭代到今天的 `2.8.0`,而现存的第三方文档镜像站点的内容却仍然定格在 Layui `2.6.8` 的版本,已严重滞后于 Layui 的当前版本,显然是不利于开发者们对 Layui 的应用。 两年来,Layui 始终处于没有中心文档的窘迫境地,虽然也一度以 **Gitee Pages** 为文档的承载,但似乎很难形成一个焦点和归属感。 随着 `2.8.0` 正式版本的发布,它所包含的上百项的更新内容,使得全新的文档站点呼之欲出。 +2021 年 Layui 原官网下线后,互联网出现了许多第三方的 Layui 文档镜像站,这在当时,给大家能继续阅读文档确实提供了便利,但原官网的下线,只是单纯一个网站自身生命周期的结束,它并不意味着 Layui 这样一个开源项目的停更,这在公告中也有清晰的阐述。但或许是由于那则公告的用词过于「悲壮」,使得各大自媒体有所误读,从而让大家都以为是 Layui 停更了。 事实上,自那以后,Layui 仍然在 Github 和 Gitee 保持活跃,并不存在所谓的停止更新,甚至从 `2.6.9` 一直迭代到今天的最新版本,而现存的第三方文档镜像站点的内容却仍然定格在 Layui `2.6.8` 的版本,已严重滞后于 Layui 的当前版本,显然是不利于开发者们对 Layui 的应用。 两年来,Layui 始终处于没有中心文档的窘迫境地,虽然也一度以 **Gitee Pages** 为文档的承载,但似乎很难形成一个焦点和归属感。 随着 `2.8.0` 正式版本的发布,它所包含的上百项的内容更新,使得全新的文档站呼之欲出。 此次上线的新版文档站,旨在为朴实归来的 Layui 提供一个新的精神「基站」,它基于 laytpl 和 markdown 驱动,在版面上进行了大量优化,内容重新编写、力求精简,以辅助大家更好地使用 Layui。 同时,Layui 文档也已和 Layui 本身一同开源在项目中,以供大家在线和离线都能阅读以及协同维护。 - **文档协作:** https://github.com/layui/layui/tree/main/docs - **文档阅读:** https://layui.dev + +--- + +
+ 我要评论 + + 更新日志 + +
diff --git a/docs/@note/2.8/upgrade-guide.md b/docs/@note/2.8/upgrade-guide.md index 38ac8486..0eefd17a 100644 --- a/docs/@note/2.8/upgrade-guide.md +++ b/docs/@note/2.8/upgrade-guide.md @@ -1,9 +1,9 @@ --- -title: Layui 2.8 《升级指南》 +title: 📑 Layui 2.8 《升级指南》 toc: false --- -# Layui 2.8 《升级指南》 +# 📑 Layui 2.8 《升级指南》 Layui `2.8` 总体向下兼容,但仍有以下变更需要注意: @@ -42,3 +42,13 @@ Layui `2.8` 总体向下兼容,但仍有以下变更需要注意: https://layui.dev/docs/versions.html 或新建 `Issue` 进行详细反馈。 + +--- + +
+ 前往 Issues + + 更新日志 + +
+ diff --git a/docs/README.md b/docs/README.md index ab7ba5a0..e078a35b 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,4 +1,24 @@ # Docs +## 文档预览 + - [最新文档](https://layui.dev) -- [2.7 文档](https://layui.dev/2.7/) \ No newline at end of file +- [2.7 文档](https://layui.dev/2.7/) + +## 目录规范 + +文档的目录与文件命名,需与组件的命名对应。子目录可自由发挥,但一般可参考以下规则: + +- `index.md` 组件主文件 +- `detail/` 组件详情文件。一般在主文件内容过大时,可将内容碎片放置在该目录中,主文件只需引用即可。 +- `examples/` 组件示例文件。 + +当创建新的组件文档时,可复制 `.layui/` 目录中放置好的文档模板,并填充对应的内容。 + +## 书写规范 + +文档采用 `HTML+Markdown+laytpl` 混合编写。 其中: + +- `HTML` 标签与 `Markdown` 混用时,必须换两行隔开 +- `laytpl` 标签语法可直接遵循 Layui 中的 laytpl 组件规则 +- 若需开启文档的右侧目录,可在对应锚点元素上添加 `lay-toc="{}"` 属性即可,具体可参考其他组件中的内容 \ No newline at end of file diff --git a/docs/anim/index.md b/docs/anim/index.md index 43d2de98..93bce696 100644 --- a/docs/anim/index.md +++ b/docs/anim/index.md @@ -16,7 +16,7 @@ toc: true

示例

-
+
   
 
@@ -154,6 +156,8 @@ tab 组件会在元素加载完毕后,自动对 tab 元素完成一次渲染 ```
+ + !}} - + + - + + + - + + \ No newline at end of file + + + \ No newline at end of file diff --git a/docs/table/index.md b/docs/table/index.md index 17f12cec..bf594a80 100644 --- a/docs/table/index.md +++ b/docs/table/index.md @@ -54,9 +54,10 @@ table 提供了以下三种渲染模式,在实际使用时,一般按情况 该方法返回当前实例对象,包含可操作当前表格的一些成员方法。 -``` +```html
+ + + + +
+ +

示例标题

+ +
+  
+
\ No newline at end of file diff --git a/docs/.layui/index.md b/docs/.layui/index.md new file mode 100644 index 00000000..cc913bd9 --- /dev/null +++ b/docs/.layui/index.md @@ -0,0 +1,34 @@ +--- +title: 某某组件 MOD_NAME +toc: true +--- + +# 某某组件 + +> 某某组件 `MOD_NAME` + +

示例

+ +
+{{- d.include("docs/MOD_NAME/detail/demo.md") }} +
+ +

API

+ +| API | 描述 | +| --- | --- | +| var MOD_NAME = layui.MOD_NAME | 获得 `MOD_NAME` 模块。 | +| [MOD_NAME.render(options)](#render) | MOD_NAME 组件渲染,核心方法。 | +| …… | …… | + +

渲染

+ +`MOD_NAME.render(options);` + +- 参数 `options` : 基础属性配置项。[#详见属性](#options) + +

属性

+ +
+{{- d.include("docs/MOD_NAME/detail/options.md") }} +
\ No newline at end of file From 49f9866edef41aa0a957253a6ca4fe69434795e8 Mon Sep 17 00:00:00 2001 From: sight <1453017105@qq.com> Date: Wed, 3 May 2023 17:24:01 +0800 Subject: [PATCH 21/22] =?UTF-8?q?=E5=85=AC=E5=85=B1=E7=B1=BB=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E7=BB=86=E8=8A=82=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/class/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/class/index.md b/docs/class/index.md index ef9ed6c1..41bed826 100644 --- a/docs/class/index.md +++ b/docs/class/index.md @@ -75,7 +75,7 @@ toc: true | layui-bg-orange | 橙 |
 
| | layui-bg-green | 绿 |
 
| | layui-bg-blue | 蓝 |
 
| -| layui-bg-purple | 紫 |
 
| +| layui-bg-purple 2.8+ | 紫 |
 
| | layui-bg-black | 深 |
 
| | layui-bg-gray | 浅 |
 
| @@ -104,7 +104,7 @@ toc: true | layui-font-orange | | | layui-font-green | 绿 | | layui-font-blue | | -| layui-font-purple | | +| layui-font-purple 2.8+ | | | layui-font-black | | | layui-font-gray | | From 7bd8a987cc6b6de0fd34ba4d2a6095f47cf637c3 Mon Sep 17 00:00:00 2001 From: sight <1453017105@qq.com> Date: Wed, 3 May 2023 18:08:35 +0800 Subject: [PATCH 22/22] =?UTF-8?q?carousel=20=E5=92=8C=20upload=20=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E7=BB=86=E8=8A=82=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/carousel/index.md | 2 +- docs/upload/detail/options.md | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/carousel/index.md b/docs/carousel/index.md index 25a13d1e..f82c8c12 100644 --- a/docs/carousel/index.md +++ b/docs/carousel/index.md @@ -64,7 +64,7 @@ inst.reload(options); // 轮播重载 -

切换

+

切换 2.8+

`inst.goto(index);` diff --git a/docs/upload/detail/options.md b/docs/upload/detail/options.md index 315d264c..3098e2fa 100644 --- a/docs/upload/detail/options.md +++ b/docs/upload/detail/options.md @@ -143,7 +143,9 @@ acceptMime: 'image/jpeg, image/png` // 只筛选 jpg,png 格式图片
+ 允许上传的文件后缀。一般结合 `accept` 属性来设定。 +
- 假设 `accept: 'file'` 类型时,那么设置 `exts: 'zip|rar|7z'` 即代表只允许上传压缩格式的文件。 @@ -188,7 +190,7 @@ acceptMime: 'image/jpeg, image/png` // 只筛选 jpg,png 格式图片 规定强制返回的数据格式。 -- 若值为 'json',则强制校验 JSON 数据格式 +- 若值为 `'json'`,则强制校验 JSON 数据格式 string