mirror of
https://gitee.com/layui/layui.git
synced 2026-01-07 08:54:34 +08:00
fix(element.tab): 改进自定义 tab 的索引获取 (#1853)
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user