优化 laydate 的 `id` 属性取值优先级

pull/1220/head
贤心 2023-03-26 15:11:22 +08:00
parent 012ae89104
commit 7c5a558e26
1 changed files with 3 additions and 1 deletions

View File

@ -116,7 +116,9 @@
// 初始化 id 参数
options = lay.extend(that.config, lay.options(elem[0])); // 继承节点上的属性
options.id = ('id' in options) ? options.id : that.index;
options.id = 'id' in options ? options.id : (
elem.attr('id') || that.index
);
// 初始化
laydate.ready(function(){