https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/arkts-custom-components-V5
@Entry
组件)@Component
组件) ┌─<─────────────────────────────────────────────<┐
│ (页面显示、路由、切换到前台) │
│ │
│ (页面隐藏、路由、切换到后台) │
│ ┌──────>┐ │
│ │ │ │
aboutToAppear ──> build ──> onDiBuild ──> onPageShow ──(Component is visible)──> onPageHide ──> aboutToAppear
│ │
│ │
│ │
│ (点击返回按钮) │
└─────────────> onBackPress ─────────────>┘
冷启动的初始化流程(MyComponent 是 @Entry 的,Child 是 MyComponent 的子组件)
MyComponent aboutToAppear --> MyComponent build --> MyComponent onDidBuild --> MyComponent onPageShow
--> Child aboutToAppear --> Child build --> Child onDidBuild