A preview error may have occurred. Switch to the Log tab to view details.

我们在学习鸿蒙应用开发的UIAbility内页面间的跳转内容的时候会遇到页面无法跳转的问题。并伴随标题的error报错

TypeScript 复制代码
@Entry
@Component
struct Index {

  build() {
    Column({ space: CommonConstants.COLUMN_SPACE }) {
        //UIAbility内页面间的跳转
      Button('Next').onClick(() => {
        router.pushUrl({
          url: 'pages/Second',
          params: {
            src: "来自index",
            msg: "message"
          }
        })
      })
    }
    .width(CommonConstants.FULL_LENGTH)
    .height(CommonConstants.FULL_LENGTH)
    .backgroundColor($r('app.color.page_background'))
  }
}

原因可能如下:

我们新建的pages/Second.ets页面是需要注册的,如下

相关推荐
爱笑的眼睛118 小时前
深入浅出ArkTS:HarmonyOS应用开发的现代化语法解析
华为·harmonyos
Kisang.17 小时前
【HarmonyOS】窗口管理实战指南
前端·华为·typescript·harmonyos·鸿蒙
it技术18 小时前
鸿蒙HarmonyOS实战开发系列课程
harmonyos
●VON20 小时前
重生之我在大学自学鸿蒙开发第一天-《基础篇》
学习·华为·harmonyos·鸿蒙
浅蓝色1 天前
flutter平台判断后续
flutter·harmonyos
程序员潘Sir1 天前
鸿蒙应用开发从入门到实战(二十):ArkUI内置弹窗组件
harmonyos·鸿蒙
旺仔Sec1 天前
2025年江西省职业院校技能大赛高职组鸿蒙应用开发赛项竞赛任务书
华为·harmonyos
Georgewu1 天前
【HarmonyOS AI赋能】朗读控件详解
harmonyos
安卓开发者2 天前
鸿蒙Next文件上传下载:全场景高效数据传输方案
华为·harmonyos