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

相关推荐
Georgewu5 小时前
【HarmonyOS 6】 The target can not be empty. check the build.profile,json5 file of
harmonyos
Georgewu5 小时前
【HarmonyOS 6】Install Failed: error: failed to install bundle.code:9568322
harmonyos
爱笑的眼睛117 小时前
HarmonyOS 应用开发新范式:深入剖析 Stage 模型与 ArkTS 状态管理
华为·harmonyos
爱笑的眼睛118 小时前
深入浅出 HarmonyOS ArkUI 3.0:基于声明式开发范式与高级状态管理构建高性能应用
华为·harmonyos
程序员潘Sir11 小时前
鸿蒙应用开发从入门到实战(一):鸿蒙应用开发概述
harmonyos
敲代码的鱼哇14 小时前
跳转原生系统设置插件 支持安卓/iOS/鸿蒙UTS组件
android·ios·harmonyos
在下历飞雨15 小时前
Kuikly基础之状态管理与数据绑定:让“孤寡”计数器动起来
ios·harmonyos
在下历飞雨15 小时前
Kuikly基础之Kuikly DSL基础组件实战:构建青蛙主界面
ios·harmonyos
HarmonyOS小助手16 小时前
HEIF:更高质量、更小体积,开启 HarmonyOS 图像新体验
harmonyos·鸿蒙·鸿蒙生态
self_myth18 小时前
[特殊字符] 深入理解操作系统核心特性:从并发到分布式,从单核到多核的全面解析
windows·macos·wpf·harmonyos