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页面是需要注册的,如下

相关推荐
见山是山-见水是水3 小时前
鸿蒙flutter第三方库适配 - 儿童故事
flutter·华为·harmonyos
2401_839633914 小时前
鸿蒙flutter第三方库适配 - URL处理应用
flutter·华为·harmonyos
不爱吃糖的程序媛4 小时前
鸿蒙三方库适配README.OpenSource文件解读
harmonyos
李李李勃谦5 小时前
Flutter 框架跨平台鸿蒙开发 - 星空日记
flutter·华为·harmonyos
2401_839633915 小时前
鸿蒙flutter第三方库适配 - 看板应用
flutter·华为·harmonyos
轻口味7 小时前
HarmonyOS 6 自定义人脸识别模型10:基于MindSpore Lite框架的自定义人脸识别功能实现
华为·harmonyos
提子拌饭1337 小时前
生命组学架构下的细胞分化与基因突变生存模拟器:基于鸿蒙Flutter的情景树渲染与状态溢出防御
flutter·华为·架构·开源·harmonyos
HarmonyOS_SDK8 小时前
【FAQ】HarmonyOS SDK 闭源开放能力 —Media Library Kit
harmonyos
SoraLuna10 小时前
「鸿蒙智能体实战记录 14」项目复盘:岁时春信智能体完整实现与能力体系总结
华为·harmonyos
HwJack2011 小时前
HarmonyOS开发中 `onKeyEvent` 事件总线:从“瞎按”到“指哪打哪”的终极掌控
华为·harmonyos