angular - 更改选项卡时,Ionic2-Super-Tabs 内容变为空
问题描述
我正在使用 ionic2-super-tabs v4.3.1。我有 3 个用于组件内部的选项卡(它不是用于主导航。用作分段控件)。我已将组件设置为根。
首次加载页面时,默认选择选项卡 0。此选项卡的内容可见。选择第二个选项卡时,内容变为空。此外,再次选择第一个选项卡时,其内容也变为空。
仅在 iOS v14.5 及更高版本上才开始突然发生问题。所有其他 iOS 版本和 Android 都没有问题。
还有其他人面临类似的问题吗?如果有人设法解决此问题,请与我分享
<ion-content class="bodyContent">
<div style="height: 100%" *ngIf="isShowTab">
<super-tabs [scrollTabs]="false" id="timeline" #timeline (tabSelect)="onTabSelect($event)">
<super-tab [root]="Page1" [rootParams]="page3Parameter" title="One"></super-tab>
<super-tab [root]="Page2" [rootParams]="page2Parameter" title="Two"></super-tab>
<super-tab [root]="Page3" [rootParams]="page1Parameter" title="Three"></super-tab>
</super-tabs>
</div>
</ion-content>
子页面模块
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { ChartPage2 } from './chart2';
@NgModule({
declarations: [
ChartPage2,
],
providers: [],
imports: [
IonicPageModule.forChild(ChartPage2),
],
})
export class ChartPageModule {}
子页面
import {Component} from '@angular/core';
import {IonicPage} from 'ionic-angular';
@IonicPage()
@Component({
selector: 'page-chart2',
templateUrl: 'chart2.html',
})
export class ChartPage2 {
constructor(){
console.log('RootPage init');
}
public onEnter(): void {
console.info('Workaround: Tab1Component -> onEnter. Loaded state:');
this.initView();
}
private initView(): void {
console.log("Root page InitView")
}
}
子页面html
<ion-content>
<div class="taptoretry">
<div style="font-weight: bold; color:black; font-size:110%; display: inline;color :rgb(70, 69, 69);">There is content in the root component.
</div>
</div>
</ion-content>
解决方案
推荐阅读
- c# - Linq Lambda Expressin Where 条件和性能问题
- python - 关于如何在 python 中比较 h5 文件中的不同组的提示?
- java - 如何将 TarArchiveOutputStream 转换为字节数组而不保存到文件系统中
- javascript - 发送到子组件时的 Redux Toolkit 状态问题
- firebase - 未定义的类'UserUpdateInfo'
- python - 有没有办法在 Repl.it 中使用 mpl_toolkits.basemap?还是类似的包?
- javascript - 为什么我的交换样式表按钮不起作用?
- three.js - 如何在 PANOLENS 中限制网格对象的旋转
- python - 使用 Flask 通过 HTML 表单中的动态行指定用户输入
- svelte - 是否有类似于 SvelteKit 中的 Angular 路由守卫的东西