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

相关推荐
啃火龙果的兔子1 分钟前
Kotlin 修改安装到桌面后的应用图标
开发语言·kotlin·harmonyos
白茶三许4 小时前
关于Flutter版本过低导致鸿蒙虚拟机启动失败的问题解决
flutter·开源·harmonyos·openharmony
不爱吃糖的程序媛7 小时前
鸿蒙PC Dock 栏隐藏“打开新窗口“功能实现详解
华为·harmonyos
穆雄雄7 小时前
Qt-for-鸿蒙PC Slider 组件开源鸿蒙开发实践
qt·开源·harmonyos
爱笑的眼睛118 小时前
HarmonyOS网络请求Kit使用详解:从基础到分布式场景实践
华为·harmonyos
爱笑的眼睛1117 小时前
HarmonyOS后台代理提醒机制深度解析与实践
华为·harmonyos
爱笑的眼睛111 天前
ArkTS接口与泛型在HarmonyOS应用开发中的深度应用
华为·harmonyos
大雷神1 天前
【鸿蒙星光分享】HarmonyOS 语音朗读功能同步教程
华为·harmonyos
不凡的凡1 天前
flutter 管理工具fvm
flutter·harmonyos
柒儿吖1 天前
Electron for HarmonyOS_PC Swifty 密码管理器适配开源鸿蒙PC开发实践
javascript·electron·harmonyos