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 () {
1111 ref . current . log = log ;
1212 const allComponents = {
1313 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 > ,
1616 Panel4 : ( props ) => < p > tab content 4</ p > ,
1717 } ;
1818 const options = {
@@ -50,6 +50,9 @@ export default function () {
5050 ref . current . log ( '[beforeSelect]' ) ;
5151 return true ;
5252 } ,
53+ onFirstSelect : function ( ) {
54+ ref . current . log ( '[onFirstSelect]' ) ;
55+ } ,
5356 onSelect : function ( ) {
5457 ref . current . log ( '[onSelect]' ) ;
5558 } ,
@@ -72,11 +75,15 @@ export default function () {
7275 } ) ;
7376 const actions = {
7477 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+ } ) ;
8087 } ,
8188 toggleDirection : ( ) => {
8289 _instance . setOption ( 'direction' , _instance . getOption ( 'direction' ) === 'ltr' ? 'rtl' : 'ltr' ) . refresh ( ) ;
You can’t perform that action at this time.
0 commit comments