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

相关推荐
HMS Core3 分钟前
基于人体骨骼点识别与跟踪,实现低时延体感游戏
游戏·华为·harmonyos
程序员黑豆42 分钟前
鸿蒙应用开发 @Builder 使用教程:从入门到精通
前端·harmonyos
OH_TPC1 小时前
【鸿蒙优选三方库】@ohos/dataorm:让 HarmonyOS 的数据库操作告别手写 SQL
harmonyos
北墨NoLimit1 小时前
别再到处 try-catch 了:一个生产级鸿蒙 HTTP 客户端的封装实录
harmonyos
小雨青年3 小时前
【HarmonyOS 7 沉浸光感深度实战】 01 ArkUI 与 HDS 两套接口如何选择
华为·harmonyos
云端漫步19874 小时前
HarmonyOS NEXT AI 智能生活助手:AI 代码解释
人工智能·华为·生活·harmonyos
nullregedit4 小时前
HarmonyOS 弦乐调音器开发实战 03:参考音、调音历史与 AppStorage 如何形成闭环
harmonyos·arkts·appstorage·preferences·audiorenderer
木合塔尔 麦麦提4 小时前
鸿蒙关系数据库代码案例
华为·harmonyos
云_杰4 小时前
鸿蒙截图工具开发实战 02:截屏权限 CUSTOM\_SCREEN\_CAPTURE——"检查"和"申请"为什么必须是两个函数
华为·harmonyos