File tree Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,20 @@ Component({
75
75
itemWidth : Number
76
76
} ,
77
77
78
+ observers : {
79
+ 'activeKey' : function ( newKey ) {
80
+ if ( ! newKey ) return ;
81
+ const index = this . data . tabList . findIndex ( tab => tab . key === newKey ) ;
82
+ this . setData ( {
83
+ currentIndex :index
84
+ } , ( ) => {
85
+ if ( this . data . scrollable ) {
86
+ this . queryMultipleNodes ( ) ;
87
+ }
88
+ } ) ;
89
+ }
90
+ } ,
91
+
78
92
/**
79
93
* 组件的初始数据
80
94
*/
Original file line number Diff line number Diff line change @@ -75,6 +75,20 @@ Component({
75
75
itemWidth : Number
76
76
} ,
77
77
78
+ observers : {
79
+ 'activeKey' : function ( newKey ) {
80
+ if ( ! newKey ) return ;
81
+ const index = this . data . tabList . findIndex ( tab => tab . key === newKey ) ;
82
+ this . setData ( {
83
+ currentIndex :index
84
+ } , ( ) => {
85
+ if ( this . data . scrollable ) {
86
+ this . queryMultipleNodes ( ) ;
87
+ }
88
+ } ) ;
89
+ }
90
+ } ,
91
+
78
92
/**
79
93
* 组件的初始数据
80
94
*/
Original file line number Diff line number Diff line change @@ -75,6 +75,20 @@ Component({
75
75
itemWidth : Number
76
76
} ,
77
77
78
+ observers : {
79
+ 'activeKey' : function ( newKey ) {
80
+ if ( ! newKey ) return ;
81
+ const index = this . data . tabList . findIndex ( tab => tab . key === newKey ) ;
82
+ this . setData ( {
83
+ currentIndex :index
84
+ } , ( ) => {
85
+ if ( this . data . scrollable ) {
86
+ this . queryMultipleNodes ( ) ;
87
+ }
88
+ } ) ;
89
+ }
90
+ } ,
91
+
78
92
/**
79
93
* 组件的初始数据
80
94
*/
You can’t perform that action at this time.
0 commit comments