mirror of https://github.com/layui/layui
fix(element.tab): 改进自定义 tab 的索引获取 (#1853)
parent
b8a6f45efa
commit
0a89d275e5
|
@ -82,7 +82,7 @@ layui.define('jquery', function(exports){
|
||||||
Element.prototype.tab = function(options){
|
Element.prototype.tab = function(options){
|
||||||
options = options || {};
|
options = options || {};
|
||||||
dom.on('click', options.headerElem, function(e){
|
dom.on('click', options.headerElem, function(e){
|
||||||
var index = $(this).index();
|
var index = $(options.headerElem).index($(this));
|
||||||
call.tabClick.call(this, {
|
call.tabClick.call(this, {
|
||||||
index: index,
|
index: index,
|
||||||
options: options
|
options: options
|
||||||
|
|
Loading…
Reference in New Issue