新增 laydate 快捷选择 `shortcuts.value `选项函数类型支持

pull/1324/head
sight 2023-08-19 07:02:32 +08:00
parent f428eceb6c
commit 0dc95b4ee9
1 changed files with 3 additions and 1 deletions

View File

@ -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];
}