@@ -1852,13 +1852,13 @@ var Tab = function (_TabBase2) {
18521852 var _this = possibleConstructorReturn ( this , ( Tab . __proto__ || Object . getPrototypeOf ( Tab ) ) . apply ( this , arguments ) ) ;
18531853
18541854 _this . items = [ ] ;
1855+ _this . firstTab = undefined ;
18551856 return _this ;
18561857 }
18571858
18581859 createClass ( Tab , [ {
18591860 key : 'created' ,
18601861 value : function created ( ) {
1861- this . activeTab = this . _tabName ( 1 ) ;
18621862 this . items = [ ] ;
18631863 this . updateStyle ( ) ;
18641864 }
@@ -1868,6 +1868,7 @@ var Tab = function (_TabBase2) {
18681868 var _this2 = this ;
18691869
18701870 Vue . nextTick ( function ( ) {
1871+ _this2 . activeTab = _this2 . firstTab ;
18711872 _this2 . _suiInit ( ) ;
18721873 } ) ;
18731874 }
@@ -1885,7 +1886,8 @@ var Tab = function (_TabBase2) {
18851886 key : 'createItem' ,
18861887 value : function createItem ( item ) {
18871888 this . items . push ( item ) ;
1888- var tabName = this . _tabName ( this . items . length ) ;
1889+ var tabName = item . path || this . _tabName ( this . items . length ) ;
1890+ if ( ! this . firstTab ) this . firstTab = tabName ;
18891891 if ( item . active == true ) {
18901892 this . activeTab = tabName ;
18911893 }
@@ -1955,6 +1957,9 @@ __decorate([vueTyped.Prop({
19551957__decorate ( [ vueTyped . Prop ( {
19561958 type : Boolean
19571959} ) ] , _TabItemBase . prototype , "active" , void 0 ) ;
1960+ __decorate ( [ vueTyped . Prop ( {
1961+ type : String
1962+ } ) ] , _TabItemBase . prototype , "path" , void 0 ) ;
19581963
19591964var TabItem = function ( _TabItemBase2 ) {
19601965 inherits ( TabItem , _TabItemBase2 ) ;
@@ -3039,7 +3044,7 @@ function tab(instance, $this) {
30393044 return function ( element ) {
30403045 return {
30413046 changeTab : function changeTab ( path ) {
3042- return $ ( element ) . tab ( 'change tab' , path ) ;
3047+ return $ ( element ) . find ( '.item' ) . tab ( 'change tab' , path ) ;
30433048 }
30443049 } ;
30453050 } ;
0 commit comments