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

相关推荐
爱笑的眼睛1130 分钟前
HarmonyOS preview 预览文件 Kit 的入门讲解(配套后端代码)
华为·harmonyos
爱笑的眼睛116 小时前
HarmonyOS后台代理提醒机制深度解析:从架构设计到场景化实践
华为·harmonyos
猫林老师8 小时前
Flutter for HarmonyOS开发指南(七):插件开发与平台能力桥接
flutter·华为·harmonyos
kirk_wang9 小时前
HarmonyOS 6.0 服务卡片实战:把「轻食刻」装进桌面,让轻断食一眼可控
华为·harmonyos
●VON1 天前
补充说明:Windows 完全可以开发 Qt 鸿蒙应用!(附专属适配方案)
windows·qt·华为·harmonyos·鸿蒙
东林知识库1 天前
鸿蒙5:HarmonyOS应用开发-线程模型
华为·harmonyos
猫林老师1 天前
Flutter for HarmonyOS开发指南(九):测试、调试与质量保障体系
flutter·wpf·harmonyos
Keya1 天前
鸿蒙Next系统手机使用Charles配置证书并抓包教程
前端·harmonyos
爱笑的眼睛111 天前
HarmonyOS DataShare数据共享机制深度解析:构建分布式应用的数据桥梁
华为·harmonyos
猫林老师1 天前
Flutter for HarmonyOS开发指南(五):性能调优与性能分析全攻略
flutter·华为·harmonyos