From 947aeb391aa199baf548bae8478537c4869d4b2d Mon Sep 17 00:00:00 2001 From: morning-star Date: Thu, 8 Jun 2023 15:57:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20tab=20=E7=B4=A2=E5=BC=95?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复 tab 索引获取错误 --- src/modules/element.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/element.js b/src/modules/element.js index 54009565..aa2ef486 100644 --- a/src/modules/element.js +++ b/src/modules/element.js @@ -155,7 +155,7 @@ layui.define('jquery', function(exports){ // Tab 删除 ,tabDelete: function(e, othis){ var li = othis || $(this).parent(); - var index = li.index('li'); + var index = li.parent().children('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');