From 5e52126c058248e0f0e59a87667b3c5876dadaf8 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, 11 Jul 2022 00:02:20 +0800 Subject: [PATCH] update --- package.json | 2 +- src/layui.js | 2 +- src/modules/laydate.js | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index f39cd745..2320acc5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "layui", "realname": "layui", - "version": "2.7.3", + "version": "2.7.4", "description": "Classic modular Front-End UI library", "main": "dist/layui.js", "license": "MIT", diff --git a/src/layui.js b/src/layui.js index ee7987fb..f2210808 100644 --- a/src/layui.js +++ b/src/layui.js @@ -15,7 +15,7 @@ } ,Layui = function(){ - this.v = '2.7.3'; // layui 版本号 + this.v = '2.7.4'; // layui 版本号 } //识别预先可能定义的指定全局对象 diff --git a/src/modules/laydate.js b/src/modules/laydate.js index ff8058ab..dfc94afd 100644 --- a/src/modules/laydate.js +++ b/src/modules/laydate.js @@ -530,6 +530,7 @@ //delete options.dateTime; //delete that.endDate; delete laydate.thisId; + typeof options.close === 'function' && options.close(that); }); } return that; @@ -1739,6 +1740,12 @@ //减去一天,得到当前月最后一天 return new Date(thisDate.getTime() - 1000*60*60*24).getDate(); }; + + // 关闭日期面板 + laydate.close = function(id){ + var elem = lay('#'+ (id ? ('layui-laydate'+ id) : Class.thisElemDate)); + elem.remove(); + }; //加载方式 isLayui ? (