Add tabGroup.getTab() method
This commit is contained in:
parent
d17be60941
commit
d6588fd2e7
1 changed files with 9 additions and 0 deletions
9
index.js
9
index.js
|
@ -63,6 +63,15 @@ class TabGroup extends EventEmitter {
|
|||
return tab;
|
||||
}
|
||||
|
||||
getTab (id) {
|
||||
for (let i in this.tabs) {
|
||||
if (this.tabs[i].id === id) {
|
||||
return this.tabs[i];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
getActiveTab () {
|
||||
if (this.tabs.length === 0) return null;
|
||||
return this.tabs[0];
|
||||
|
|
Loading…
Reference in a new issue