mirror of
https://gitee.com/layui/layui.git
synced 2025-04-05 17:38:02 +08:00
fix(tab): 修复指定元素渲染,添加和删除选项卡会导致全部 tab 重新渲染的问题 (#2386)
* fix(tab): 指定元素渲染会导致全部 tab 重新渲染的问题 * fix(tab): 添加和删除选项卡会导致全部 tab 重新渲染的问题
This commit is contained in:
parent
e9b4febe25
commit
68ab68b8b0
@ -53,7 +53,7 @@ layui.define('jquery', function(exports){
|
|||||||
// 是否添加即切换
|
// 是否添加即切换
|
||||||
options.change && this.tabChange(filter, options.id);
|
options.change && this.tabChange(filter, options.id);
|
||||||
titElem.data('LAY_TAB_CHANGE', options.change);
|
titElem.data('LAY_TAB_CHANGE', options.change);
|
||||||
call.tabAuto(options.change ? 'change' : null);
|
call.tabAuto(options.change ? 'change' : null, tabElem);
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -219,7 +219,7 @@ layui.define('jquery', function(exports){
|
|||||||
item.eq(index).remove();
|
item.eq(index).remove();
|
||||||
}
|
}
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
call.tabAuto();
|
call.tabAuto(null, tabElem);
|
||||||
}, 50);
|
}, 50);
|
||||||
|
|
||||||
layui.event.call(this, MOD_NAME, 'tabDelete('+ filter +')', {
|
layui.event.call(this, MOD_NAME, 'tabDelete('+ filter +')', {
|
||||||
@ -420,7 +420,9 @@ layui.define('jquery', function(exports){
|
|||||||
|
|
||||||
// Tab 选项卡
|
// Tab 选项卡
|
||||||
tab: function(elem){
|
tab: function(elem){
|
||||||
call.tabAuto.call({}, elem);
|
var TAB_ELEM = '.layui-tab';
|
||||||
|
var targetElem = elem || $(TAB_ELEM + elemFilter);
|
||||||
|
call.tabAuto.call({}, null, targetElem);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导航菜单
|
// 导航菜单
|
||||||
|
Loading…
Reference in New Issue
Block a user