mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
refactor(all): make all method return a promise
This commit is contained in:
@ -42,7 +42,6 @@ See the [Tabs API Docs](../Tabs/) for more details on configuring Tabs.
|
||||
|
||||
| Method | Description |
|
||||
| ----------- | ------------------------------------ |
|
||||
| `getTabId` | Get the Id for the tab |
|
||||
| `setActive` | Set the active component for the tab |
|
||||
|
||||
|
||||
|
||||
@ -97,6 +97,11 @@ export class Tab {
|
||||
@Event() ionTabMutated!: EventEmitter<void>;
|
||||
|
||||
componentWillLoad() {
|
||||
// Set default name
|
||||
if (!this.name && typeof this.component === 'string') {
|
||||
this.name = this.component;
|
||||
}
|
||||
|
||||
if (Build.isDev) {
|
||||
if (this.component && this.el.childElementCount > 0) {
|
||||
console.error('You can not use a lazy-loaded component in a tab and inlined content at the same time.' +
|
||||
@ -118,18 +123,6 @@ export class Tab {
|
||||
this.ionTabMutated.emit();
|
||||
}
|
||||
|
||||
/** Get the Id for the tab */
|
||||
@Method()
|
||||
getTabId(): string | null {
|
||||
if (this.name) {
|
||||
return this.name;
|
||||
}
|
||||
if (typeof this.component === 'string') {
|
||||
return this.component;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/** Set the active component for the tab */
|
||||
@Method()
|
||||
async setActive(): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user