Skip to content

Commit e311268

Browse files
update example
1 parent 55e94db commit e311268

File tree

1 file changed

+14
-7
lines changed
  • example/complete-example/src/components/tabs

1 file changed

+14
-7
lines changed

example/complete-example/src/components/tabs/tabs.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff 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();

0 commit comments

Comments
 (0)