diff --git a/index.js b/index.js index ecfbcc2..8460bf0 100644 --- a/index.js +++ b/index.js @@ -57,6 +57,9 @@ class TabGroup extends EventEmitter { } addTab (args = this.options.newTab) { + if (typeof args === "function") { + args = args(this); + } let id = this.newTabId; this.newTabId++; let tab = new Tab(this, id, args);