From 0d9e533737696669d9008ce80726bcf2ae07809e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Sun, 12 Mar 2023 10:32:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20tab=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81=EF=BC=8C=E5=B9=B6=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E4=B8=8A=E4=B8=AA=E7=89=88=E6=9C=AC=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84=20BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/element.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/element.js b/src/modules/element.js index 75c26995..17f0d67c 100644 --- a/src/modules/element.js +++ b/src/modules/element.js @@ -153,9 +153,9 @@ layui.define('jquery', function(exports){ ,tabDelete: function(e, othis){ var li = othis || $(this).parent(); var index = li.index(); - var parents = li.parents('.layui-tab').eq(0); - var item = parents.children('.layui-tab-content>.layui-tab-item'); - var filter = parents.attr('lay-filter'); + var tabElem = li.closest('.layui-tab'); + var item = tabElem.children('.layui-tab-content').children('.layui-tab-item'); + var filter = tabElem.attr('lay-filter'); if(li.hasClass(THIS)){ if (li.next()[0] && li.next().is('li')){ @@ -174,7 +174,7 @@ layui.define('jquery', function(exports){ }, 50); layui.event.call(this, MOD_NAME, 'tabDelete('+ filter +')', { - elem: parents, + elem: tabElem, index: index }); }