mirror of
https://gitcode.com/JianFeeeee/TrulyMEM-TrueHumanMEM.git
synced 2026-10-04 00:14:26 +00:00
refactor: move HarmonyOS project files from harmony/ to branch root
This commit is contained in:
35
entry/src/main/ets/pages/Index.ets
Normal file
35
entry/src/main/ets/pages/Index.ets
Normal file
@ -0,0 +1,35 @@
|
||||
import { MainPage } from './MainPage';
|
||||
import { SettingsPage } from './SettingsPage';
|
||||
import { GraphDatabase } from '../model/GraphDatabase';
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
struct Index {
|
||||
@State currentIndex: number = 0;
|
||||
private db: GraphDatabase = new GraphDatabase();
|
||||
|
||||
aboutToAppear() {
|
||||
this.db.init(getContext(this));
|
||||
}
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
Tabs({ index: this.currentIndex, barPosition: BarPosition.End }) {
|
||||
TabContent() {
|
||||
MainPage({ db: this.db })
|
||||
}
|
||||
.tabBar('🌌 TrulyMEM')
|
||||
|
||||
TabContent() {
|
||||
SettingsPage()
|
||||
}
|
||||
.tabBar('⚙ 设置')
|
||||
}
|
||||
.width('100%')
|
||||
.height('100%')
|
||||
.onChange((index: number) => { this.currentIndex = index; })
|
||||
}
|
||||
.width('100%')
|
||||
.height('100%')
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user