feat(entry): 建立 MVVM+data 分层骨架,接入 V2 状态管理与 Navigation 路由
This commit is contained in:
35
entry/src/main/ets/pages/DetailPage.ets
Normal file
35
entry/src/main/ets/pages/DetailPage.ets
Normal file
@@ -0,0 +1,35 @@
|
||||
import { AppColor, AppSpacing, AppFontSize, AppButton } from 'uikit';
|
||||
import { AppRouter } from '../router/AppRouter';
|
||||
|
||||
/**
|
||||
* 详情页:NavDestination 页面,演示 Navigation 路由与 @Param 入参。
|
||||
*/
|
||||
@ComponentV2
|
||||
export struct DetailPage {
|
||||
@Param title: string = '';
|
||||
|
||||
build() {
|
||||
NavDestination() {
|
||||
Column({ space: AppSpacing.md }) {
|
||||
Text(this.title)
|
||||
.fontSize(20)
|
||||
.fontWeight(FontWeight.Bold)
|
||||
.fontColor(AppColor.textPrimary)
|
||||
Text('这是一个 NavDestination 页面,用于演示 Navigation 路由。')
|
||||
.fontSize(AppFontSize.body)
|
||||
.fontColor(AppColor.textSecondary)
|
||||
AppButton({
|
||||
text: '返回',
|
||||
onTap: () => {
|
||||
AppRouter.pop();
|
||||
}
|
||||
})
|
||||
}
|
||||
.width('100%')
|
||||
.height('100%')
|
||||
.padding(AppSpacing.lg)
|
||||
.backgroundColor(AppColor.background)
|
||||
}
|
||||
.title('详情')
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user