Files
hormony-app/entry/src/main/ets/generated/Index.ets
T
2025-12-19 17:58:00 +08:00

43 lines
1.0 KiB
Plaintext

import { EmptyPagePathStack } from './view/EmptyPagePathStack';
import { SecondPageSearch } from './view/SecondPageSearch';
import { BMICalculator } from './pages/BMICalculator';
@Entry
@Component
struct Index {
private scroller: Scroller = new Scroller();
@Provide('appPathStack') appPathStack: NavPathStack = new NavPathStack();
@State title: string = 'page_title';
@Builder
PageMap(name: string) {
if (name === 'SearchPage') {
SecondPageSearch()
} else {
EmptyPagePathStack()
}
}
build() {
Navigation(this.appPathStack) {
Column() {
Scroll(this.scroller) {
Column() {
BMICalculator()
}
.width('100%')
.justifyContent(FlexAlign.Start)
.alignItems(HorizontalAlign.Start)
}
.scrollable(ScrollDirection.Vertical)
.scrollBar(BarState.Off)
.width('100%')
}
.backgroundColor('#F1F3F5')
.height('100%')
}
.navDestination(this.PageMap)
.hideTitleBar(true)
.mode(NavigationMode.Stack)
}
}