Files
harmony-client/entry/src/main/ets/pages/DetailPage.ets

36 lines
940 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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('详情')
}
}