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

相关推荐
sam.li1 天前
鸿蒙HAR对外发布安全流程
安全·华为·harmonyos
sam.li1 天前
鸿蒙APP安全体系
安全·华为·harmonyos
ChinaDragon1 天前
HarmonyOS:通过组件导航设置自定义区域
harmonyos
人工智能知识库1 天前
华为HCIP-HarmonyOS Application Developer题库 H14-231 (26年最新带解析)
华为·harmonyos·hcip-harmonyos·h14-231
搬砖的kk1 天前
鸿蒙 PC 版 DevEco Studio 使用 OHPM 下载三方库教程
华为·harmonyos
游戏技术分享2 天前
【鸿蒙游戏技术分享 第75期】AGC后台批量导入商品失败,提示“参数错误”
游戏·华为·harmonyos
No Silver Bullet2 天前
HarmonyOS NEXT开发进阶(十七):WebView 拉起 H5 页面
华为·harmonyos
liuhaikang2 天前
【鸿蒙HarmonyOS Next App实战开发】口语小搭档——应用技术实践
harmonyos
liuhaikang2 天前
鸿蒙VR视频播放库——md360player
音视频·vr·harmonyos
飞露2 天前
鸿蒙Preview预览文件失败原因
华为·harmonyos