wwf
5 天以前 8e1b89c65db438797d2d89c508f3e9883bbd7c20
entry/src/main/ets/pages/MainPage.ets
@@ -1,4 +1,7 @@
import { Home } from './home/Home'
import { MessagePage } from './message/MessagePage'
import { SearchPage } from './search/SearchPage'
import { AccountPage } from  './account/AccountPage'
/**
 * @Description : 底部导航,APP模块
@@ -17,7 +20,7 @@
    { icon: 'tabs_message_icon', title: '消息' },
    { icon: 'tabs_account_icon', title: '我的' }
  ]
  @State selectIndex: number = 0
  @State selectIndex: number = 3
  private tabController: TabsController = new TabsController()
  @Builder tabItem(icon: ResourceStr,title: string,index: number){
@@ -39,18 +42,16 @@
      Tabs({barPosition: BarPosition.End,controller: this.tabController}){
        ForEach(this.tabBarList,(item: TabBarBase,index:number) => {
          TabContent(){
            if (index === 0) {
            if (this.selectIndex == 0) {
              Home()
            } else if (index === 1){
              // SearchPage()
            } else if (index === 2){
              // MessagePage()
            } else if (index === 3){
              // AccountPage()
            } else if (this.selectIndex == 1){
              SearchPage()
            } else if (this.selectIndex == 2){
              MessagePage()
            } else if (this.selectIndex == 3){
              AccountPage()
            }
          }
          //调用自定义的样式
          // .tabBar(this.tabItem(item.icon,item.title,index))
        })
      }
      .barHeight(0)