-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIndex.ets
40 lines (33 loc) · 893 Bytes
/
Index.ets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { CalculateView } from './calculate/CalculatePage';
import { ConvertView, ConvertViewModel } from './convert/ConvertPage';
@Entry
@Component
struct Index {
@State message: string = 'Hello World';
@Provide convertViewModel: ConvertViewModel = new ConvertViewModel();
aboutToAppear(): void {
this.convertViewModel.requestRefreshHome = () =>{
// 这里处理 Home的 逻辑调用
}
}
onPageShow(): void {
this.convertViewModel.onPageShow();
}
build() {
Column() {
Stack({ alignContent: Alignment.TopEnd}) {
Tabs({ barPosition: BarPosition.Start}) {
TabContent() {
CalculateView();
}
.tabBar($r("app.string.calculate"))
TabContent() {
ConvertView();
}
.tabBar($r("app.string.convert"))
}
}
}
.height('100%').width('100%')
}
}