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

相关推荐
Hello__77776 小时前
开源鸿蒙 Flutter 实战|页面加载进度条全流程实现
flutter·开源·harmonyos
nashane6 小时前
HarmonyOS Text组件堆叠布局中的文字缩进避让技术详解
华为·harmonyos·harmonyos 5
爱艺江河7 小时前
智慧合规的HarmonyOS原生实践:与OpenClaw适配的项目方案浅析
人工智能·华为·harmonyos
三声三视9 小时前
ArkTS Navigation 路由实战:从 Router 迁移到 NavPathStack,打造企业级路由体系
华为·harmonyos·鸿蒙
Swift社区11 小时前
System + AI:下一代 鸿蒙App 架构
人工智能·架构·harmonyos
新小梦12 小时前
DevEco Studio修改HarmonyOS为OpenHarmony
harmonyos
IntMainJhy13 小时前
Flutter 三方库 shimmer 的鸿蒙化适配与实战指南
flutter·华为·harmonyos
IntMainJhy14 小时前
Flutter 三方库 flutter_slidable 的鸿蒙化适配与实战指南
flutter·华为·harmonyos
@不误正业14 小时前
HarmonyOS-6.0-AI全栈能力解析-Data-Augmentation-Kit到智能体开发实战
人工智能·华为·harmonyos·开源鸿蒙