我是靠谱客的博主 迷你苗条,这篇文章主要介绍html默认选中tab,动态默认选中tab问题,现在分享给大家,希望可以做个参考。

我按照老师写的代码,怎么都不会默认选中第二个。求解答。

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内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(54)

评论列表共有 0 条评论

立即
投稿
返回
顶部