Merge pull request #1271 from Sight-wcg/patch/tab-title-li-index

修复 tab 组件 `layui-tab-title` 中有其他元素时,li 获取错误的下标,导致点击删除按钮对应的 tab-content 未删除的问题
pull/1273/head
贤心 2023-06-05 12:50:44 +08:00 committed by GitHub
commit c411750f34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -154,7 +154,7 @@ layui.define('jquery', function(exports){
// Tab 删除
,tabDelete: function(e, othis){
var li = othis || $(this).parent();
var index = li.index();
var index = li.index('li');
var tabElem = li.closest('.layui-tab');
var item = tabElem.children('.layui-tab-content').children('.layui-tab-item');
var filter = tabElem.attr('lay-filter');