Feat: 新增页面
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
@Entry
|
||||
@Component
|
||||
struct Hello {
|
||||
@State message: string = 'Hello World';
|
||||
@State message: string = '基于鸿蒙开发';
|
||||
|
||||
build() {
|
||||
Row() {
|
||||
|
||||
@@ -40,13 +40,39 @@ struct Index {
|
||||
.onClick(() => {
|
||||
console.log("用户操作:点击按钮")
|
||||
let uiContext: UIContext = this.getUIContext();
|
||||
let router = uiContext.getRouter();
|
||||
router.pushUrl({
|
||||
let router1 = uiContext.getRouter();
|
||||
router1.pushUrl({
|
||||
url: 'pages/BMI'
|
||||
}).then(() => {
|
||||
console.log('系统提示:跳转成功')
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Column() {
|
||||
Button('[关于] 关于此应用')
|
||||
.width('80%')
|
||||
.height(50)
|
||||
.type(ButtonType.Capsule)
|
||||
.fontSize(18)
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.backgroundColor('#4C61E4')
|
||||
.margin({ bottom: 80 })
|
||||
}
|
||||
.width('100%')
|
||||
.height('80%')
|
||||
.justifyContent(FlexAlign.End)
|
||||
.alignItems(HorizontalAlign.Center)
|
||||
.onClick(() => {
|
||||
console.log("用户操作:点击按钮")
|
||||
let uiContext: UIContext = this.getUIContext();
|
||||
let router2 = uiContext.getRouter();
|
||||
router2.pushUrl({
|
||||
url: 'pages/Hello'
|
||||
}).then(() => {
|
||||
console.log('系统提示:跳转成功')
|
||||
})
|
||||
})
|
||||
}
|
||||
.width('100%')
|
||||
.height('100%')
|
||||
|
||||
Reference in New Issue
Block a user