我按照老师写的代码,怎么都不会默认选中第二个。求解答。
import {Component} from '@angular/core';
import {HomePage} from '../home/home';
import {AboutPage} from '../about/about';
import {ContactPage} from '../contact/contact';
import {Tabs} from 'ionic-angular';
import {Injectable,ViewChild} from '@angular/core';
@Component({
templateUrl: 'build/pages/tabs/tabs.html'
})
export class TabsPage {
@ViewChild('myTabs') tabRef: Tabs;
private tab1Root: any;
private tab2Root: any;
private tab3Root: any;
constructor() {
// this tells the tabs component which Pages
// should be each tab's root Page
this.tab1Root = HomePage;
this.tab2Root = AboutPage;
this.tab3Root = ContactPage;
}
ionViewDidEnter(){
this.tabRef.select(1);
}
}
默认选中的还是第一个。版本是32.
最后
以上就是迷你苗条最近收集整理的关于html默认选中tab,动态默认选中tab问题的全部内容,更多相关html默认选中tab内容请搜索靠谱客的其他文章。
发表评论 取消回复