File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
example/complete-example/src/components/tabs Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ export default function () {
11
11
ref . current . log = log ;
12
12
const allComponents = {
13
13
Panel1 : ( props ) => < p > tab content 1</ p > ,
14
- Panel2 : < p > tab content 2</ p > ,
15
- Panel3 : < p > tab content 3</ p > ,
14
+ Panel2 : ( props ) => < p > tab content 2</ p > ,
15
+ Panel3 : ( props ) => < p > tab content 3</ p > ,
16
16
Panel4 : ( props ) => < p > tab content 4</ p > ,
17
17
} ;
18
18
const options = {
@@ -50,6 +50,9 @@ export default function () {
50
50
ref . current . log ( '[beforeSelect]' ) ;
51
51
return true ;
52
52
} ,
53
+ onFirstSelect : function ( ) {
54
+ ref . current . log ( '[onFirstSelect]' ) ;
55
+ } ,
53
56
onSelect : function ( ) {
54
57
ref . current . log ( '[onSelect]' ) ;
55
58
} ,
@@ -72,11 +75,15 @@ export default function () {
72
75
} ) ;
73
76
const actions = {
74
77
openNewTab : ( ) => {
75
- _instance . open ( {
76
- title : 'new tab' ,
77
- closable : false ,
78
- panelComponent : ( props ) => < p > new tab content</ p > ,
79
- } ) ;
78
+ _instance
79
+ . open ( {
80
+ title : 'new tab' ,
81
+ closable : false ,
82
+ panelComponent : ( props ) => < p > new tab content</ p > ,
83
+ } )
84
+ . then ( ( ) => {
85
+ ref . current . log ( '(new tab is open)' ) ;
86
+ } ) ;
80
87
} ,
81
88
toggleDirection : ( ) => {
82
89
_instance . setOption ( 'direction' , _instance . getOption ( 'direction' ) === 'ltr' ? 'rtl' : 'ltr' ) . refresh ( ) ;
You can’t perform that action at this time.
0 commit comments