- 新建 MainPage.ets,用 GridRow 响应式布局组合星图+聊天 - Index.ets 改为 2 Tab(TrulyMEM + 设置) - GraphPage/ChatPage 接收 @Prop db 从父组件传入 - 恢复 README.md / README_EN.md 的特别鸣谢部分
36 lines
914 B
Plaintext
36 lines
914 B
Plaintext
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%')
|
|
}
|
|
}
|