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

pull/1855/head
morning-star 7 months ago committed by GitHub
parent b8a6f45efa
commit 0a89d275e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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…
Cancel
Save