| | |
| | | import { Home } from './home/Home' |
| | | import { MessagePage } from './message/MessagePage' |
| | | import { SearchPage } from './search/SearchPage' |
| | | |
| | | /** |
| | | * @Description : 底部导航,APP模块 |
| | |
| | | { icon: 'tabs_message_icon', title: '消息' }, |
| | | { icon: 'tabs_account_icon', title: '我的' } |
| | | ] |
| | | @State selectIndex: number = 0 |
| | | @State selectIndex: number = 2 |
| | | private tabController: TabsController = new TabsController() |
| | | |
| | | @Builder tabItem(icon: ResourceStr,title: string,index: number){ |
| | |
| | | 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 (this.selectIndex == 1){ |
| | | SearchPage() |
| | | } else if (this.selectIndex == 2){ |
| | | MessagePage() |
| | | } else if (index === 3){ |
| | | // AccountPage() |
| | | } |
| | | } |
| | | //调用自定义的样式 |
| | | // .tabBar(this.tabItem(item.icon,item.title,index)) |
| | | }) |
| | | } |
| | | .barHeight(0) |