mirror of https://github.com/layui/layui
优化 dropdown 的 `id` 属性取值优先级
parent
5663d60d21
commit
461ae352b8
|
@ -113,8 +113,10 @@ layui.define(['jquery', 'laytpl', 'lay'], function(exports){
|
||||||
return newThat.reload(options);
|
return newThat.reload(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
//初始化 id 参数
|
// 初始化 id 属性 - 优先取 options > 元素 id > 自增索引
|
||||||
options.id = ('id' in options) ? options.id : that.index;
|
options.id = 'id' in options ? options.id : (
|
||||||
|
options.elem.attr('id') || that.index
|
||||||
|
);
|
||||||
|
|
||||||
if(options.show) that.render(rerender); //初始即显示
|
if(options.show) that.render(rerender); //初始即显示
|
||||||
that.events(); //事件
|
that.events(); //事件
|
||||||
|
|
Loading…
Reference in New Issue