ionic-team / ionic-team/ionic-framework

bug: certain tab methods missing on framework integrations

未关闭
#19,918 17 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
package: angular package: react package: vue type: bug
主要语言
TypeScript
星标
52.7k
派生
13.3k
平均合并
1 天 15 小时
30 天内合并 PR
51

描述

# Bug Report

**Ionic version:**

[x] **4.11.5**

**Current behavior:**
```this.tabs.getTab is not a function```

**Expected behavior:**
`getTab` should return tab component

**Steps to reproduce:**
on page with tabs:
`@ViewChild(IonTabs, { static: false }) tabs: IonTabs;`
And run this code:
```
const currentTab = this.tabs.getSelected();
console.log(this.tabs.getTab(currentTab));
```
This gives error: ```ERROR TypeError: "this.tabs.getTab is not a function"```
In console:
```error TS2339: Property 'getTab' does not exist on type 'IonTabs'.```

According to docs: https://ionicframework.com/docs/api/tabs :
```
getTab
--
Get a specific tab by the value of its tab property or an element reference.
getTab(tab: string \| HTMLIonTabElement) => Promise
```

**Related code:**

```
const currentTab = this.tabs.getSelected();
console.log(this.tabs.getTab(currentTab));
```

**Other information:**

**Ionic info:**

```
Ionic:

Ionic CLI : 5.4.2
Ionic Framework : @ionic/angular 4.11.5
@angular-devkit/build-angular : 0.803.8
@angular-devkit/schematics : 8.3.8
@angular/cli : 8.3.19
@ionic/angular-toolkit : 2.0.0

Cordova:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : ios 5.0.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.0, (and 8 other plugins)

Utility:

cordova-res : not installed
native-run : not installed

System:

Android SDK Tools : 26.1.1
NodeJS : v12.13.0
npm : 6.12.0
OS : Linux 4.15
```

贡献指南

打开贡献指南

调研方向

Start at the IonTabs entry point in @ionic/angular and compare the documented getTab API with the available methods. Reproduce the TypeScript error using the shown getSelected/getTab example; done means getTab is available on IonTabs and returns the tab component as documented.

由索引模型根据 Issue 内容生成。

评估

技术栈
angular, typescript
领域
frontend, mobile-dev
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
30/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。