From 0dc95b4ee96bc263c254b2d544bc88e9db253ecb Mon Sep 17 00:00:00 2001 From: sight <1453017105@qq.com> Date: Sat, 19 Aug 2023 07:02:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20laydate=20=E5=BF=AB?= =?UTF-8?q?=E6=8D=B7=E9=80=89=E6=8B=A9=20`shortcuts.value=20`=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E5=87=BD=E6=95=B0=E7=B1=BB=E5=9E=8B=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/laydate.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/laydate.js b/src/modules/laydate.js index 3da065fe..36973a07 100644 --- a/src/modules/laydate.js +++ b/src/modules/laydate.js @@ -591,7 +591,9 @@ return shortcutBtns.join(''); }()).find('li').on('click', function (event) { var btnSetting = options.shortcuts[this.dataset['index']] || {}; - var value = btnSetting.value || []; + var value = (typeof btnSetting.value === 'function' + ? btnSetting.value() + : btnSetting.value) || []; if (!layui.isArray(value)) { value = [value]; }