lib/kissy/5.0.0-alpha.3/build/tabs-debug.js
function (item, index) {
                var self = this, bar = self.get('bar'), selectedTab, tabItem, panelItem, barChildren = bar.get('children'), body = self.get('body');
                if (typeof index === 'undefined') {
                    index = barChildren.length;
                }
                tabItem = fromTabItemConfigToTabConfig(item);
                panelItem = { content: item.content };
                bar.addChild(tabItem, index);
                selectedTab = barChildren[index];
                body.addChild(panelItem, index);
                if (item.selected) {
                    bar.set('selectedTab', selectedTab);
                    body.set('selectedPanelIndex', index);
                }
                return self;
            }
function (item, index) {
                var self = this, bar = self.get('bar'), selectedTab, tabItem, panelItem, barChildren = bar.get('children'), body = self.get('body');
                if (typeof index === 'undefined') {
                    index = barChildren.length;
                }
                tabItem = fromTabItemConfigToTabConfig(item);
                panelItem = { content: item.content };
                bar.addChild(tabItem, index);
                selectedTab = barChildren[index];
                body.addChild(panelItem, index);
                if (item.selected) {
                    bar.set('selectedTab', selectedTab);
                    body.set('selectedPanelIndex', index);
                }
                return self;
            }
function ( item , index ) { var self = this , bar = self . get ( 'bar' ) , selectedTab , tabItem , panelItem , barChildren = bar . get ( 'children' ) , body = self . get ( 'body' ) ; if ( typeof index === 'undefined' ) { index = barChildren . length ; } tabItem = fromTabItemConfigToTabConfig ( item ) ; panelItem = { content : item . content } ; bar . addChild ( tabItem , index ) ; selectedTab = barChildren [ index ] ; body . addChild ( panelItem , index ) ; if ( item . selected ) { bar . set ( 'selectedTab' , selectedTab ) ; body . set ( 'selectedPanelIndex' , index ) ; } return self ; }
fired when selected tab is changed
@event afterSelectedTabChange
@member KISSY.Tabs
@param {KISSY.Event.CustomEvent.Object} e
@param {KISSY.Tabs.Tab} e.newVal selected tab
 
fired before selected tab is changed
@event beforeSelectedTabChange
@member KISSY.Tabs
@param {KISSY.Event.CustomEvent.Object} e
@param {KISSY.Tabs.Tab} e.newVal tab to be selected
 
fired when tab is closed
@event afterTabClose
@member KISSY.Tabs
@param {KISSY.Event.CustomEvent.Object} e
@param {KISSY.Tabs.Tab} e.target closed tab
 
fired before tab is closed
@event beforeTabClose
@member KISSY.Tabs
@param {KISSY.Event.CustomEvent.Object} e
@param {KISSY.Tabs.Tab} e.target tab to be closed
 
add one item to tabs
@param {Object} item item description
@param {String} item.content tab panel html
@param {String} item.title tab bar html
@param {String} item.closable whether this tab is closable
@param {Number} index insert index
@chainable
fired when selected tab is changed