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

相关推荐
ITUnicorn6 小时前
【HarmonyOS 6】进度组件实战:打造精美的数据可视化
华为·harmonyos·arkts·鸿蒙·harmonyos6
松叶似针8 小时前
Flutter三方库适配OpenHarmony【secure_application】— 五平台隐私保护机制横向对比
flutter·harmonyos
平安的平安8 小时前
【OpenHarmony】React Native鸿蒙实战:SegmentControl 分段控件详解
react native·react.js·harmonyos
平安的平安10 小时前
【OpenHarmony】React Native鸿蒙实战:ProgressRing 环形进度详解
react native·react.js·harmonyos
平安的平安10 小时前
【OpenHarmony】React Native鸿蒙实战:ProgressBar 进度条详解
react native·react.js·harmonyos
前端不太难10 小时前
未来的鸿蒙 App,还需要“首页”吗?
华为·状态模式·harmonyos
平安的平安10 小时前
【OpenHarmony】React Native鸿蒙实战:SearchBar 搜索栏详解
react native·react.js·harmonyos
HwJack2019 小时前
HarmonyOS APP UI单位适配深度实践:vp/fp/px的工程化解决方案分享
ui·华为·harmonyos
无巧不成书02181 天前
【RN鸿蒙教学|第10课时】应用异常处理+性能优化实战:夯实稳定性,备战打包部署
react native·华为·性能优化·交互·harmonyos
键盘鼓手苏苏1 天前
Flutter for OpenHarmony:git 纯 Dart 实现的 Git 操作库(在应用内实现版本控制) 深度解析与鸿蒙适配指南
开发语言·git·flutter·华为·rust·自动化·harmonyos