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

相关推荐
纯爱掌门人16 小时前
鸿蒙日历服务实践:把应用里的事件写进用户的日程表
华为·harmonyos
HwJack2016 小时前
HarmonyOS开发中ArkTS @Extend装饰器:给组件“装外挂”,让样式复用不再将就
华为·harmonyos
想你依然心痛16 小时前
HarmonyOS 5.0音视频开发实战:基于ArkMedia Kit的实时直播与AI增强处理系统
人工智能·音视频·harmonyos
芙莉莲教你写代码17 小时前
Flutter 框架跨平台鸿蒙开发 - 谜语大全
flutter·华为·harmonyos
2501_920627611 天前
Flutter 框架跨平台鸿蒙开发 - 古文学习应用
学习·flutter·harmonyos
芙莉莲教你写代码1 天前
Flutter 框架跨平台鸿蒙开发 - 魔术教学
flutter·华为·harmonyos
纯爱掌门人1 天前
鸿蒙文件预览开发实践:从打开文件到加速感知
华为·harmonyos
云和数据.ChenGuang1 天前
当智能体遇上原生鸿蒙:开启下一代操作系统的“智慧觉醒”
华为·harmonyos
左手厨刀右手茼蒿1 天前
Flutter 三方库 bs58 的鸿蒙化适配指南 - 在鸿蒙系统上构建极致、高效的 Base58 数字货币与区块链数据编解码引擎
flutter·harmonyos·鸿蒙·openharmony
加农炮手Jinx1 天前
Flutter 组件 substrate_bip39 的适配 鸿蒙Harmony 实战 - 驾驭区块链级助记词原语、实现鸿蒙端金融级 BIP39 安全私钥推导方案
flutter·harmonyos·鸿蒙·openharmony·substrate_bip39