fix(element.tab): 改进自定义 tab 的索引获取 (#1853)

This commit is contained in:
morning-star 2024-05-04 16:29:29 +08:00 committed by GitHub
parent b8a6f45efa
commit 0a89d275e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -82,7 +82,7 @@ layui.define('jquery', function(exports){
Element.prototype.tab = function(options){
options = options || {};
dom.on('click', options.headerElem, function(e){
var index = $(this).index();
var index = $(options.headerElem).index($(this));
call.tabClick.call(this, {
index: index,
options: options