mirror of https://github.com/layui/layui
优化 transfer 的 `id` 属性取值优先级
parent
9c6a0a8182
commit
40d3c330ab
|
@ -148,8 +148,11 @@ layui.define(['laytpl', 'form'], function(exports){
|
||||||
options.data = options.data || [];
|
options.data = options.data || [];
|
||||||
options.value = options.value || [];
|
options.value = options.value || [];
|
||||||
|
|
||||||
//索引
|
// 初始化 id 属性 - 优先取 options > 元素 id > 自增索引
|
||||||
that.key = options.id || that.index;
|
options.id = 'id' in options ? options.id : (
|
||||||
|
elem.attr('id') || that.index
|
||||||
|
);
|
||||||
|
that.key = options.id;
|
||||||
|
|
||||||
//插入组件结构
|
//插入组件结构
|
||||||
othis.html(that.elem);
|
othis.html(that.elem);
|
||||||
|
|
Loading…
Reference in New Issue