diff --git a/src/modules/element.js b/src/modules/element.js index 631f6752..3d73631a 100644 --- a/src/modules/element.js +++ b/src/modules/element.js @@ -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