点击tabbar
This commit is contained in:
@@ -14,7 +14,8 @@ export struct TabBarComp {
|
||||
@State
|
||||
isLandscape: boolean = false
|
||||
listenerScreen = mediaquery.matchMediaSync('(orientation: landscape) and (device-type: tablet)')
|
||||
|
||||
@Provide
|
||||
toTop:boolean=false;
|
||||
aboutToAppear() {
|
||||
this.listenerScreen.on('change', (mediaQueryResult) => {
|
||||
this.isLandscape = mediaQueryResult.matches
|
||||
@@ -53,6 +54,7 @@ export struct TabBarComp {
|
||||
.barPosition(this.isLandscape ? BarPosition.Start : BarPosition.End)
|
||||
.onTabBarClick((index) => {
|
||||
this.activeIndex = index
|
||||
this.toTop=!this.toTop
|
||||
})
|
||||
.barHeight(this.isLandscape ? $r('app.float.tab_bar_item_height_lg') : $r('app.float.tab_bar_item_height_sm'))
|
||||
.scrollable(false)
|
||||
|
||||
Reference in New Issue
Block a user