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

相关推荐
盐焗西兰花14 分钟前
鸿蒙学习实战之路-Share Kit系列(16/17)-隔空传送与可信任设备
学习·华为·harmonyos
互联网散修1 小时前
零基础鸿蒙应用开发第二十七节:全局商品管理之单利模式
harmonyos·鸿蒙
木斯佳2 小时前
HarmonyOS 6实战:HarmonyOS轻量化交互的两种方案改造与实践(下)
华为·交互·harmonyos
弓.长.2 小时前
ReactNative for OpenHarmony项目鸿蒙化三方库:lottie-react-native — Lottie动画组件
react native·react.js·harmonyos
弓.长.5 小时前
ReactNative for OpenHarmony项目鸿蒙化三方库:react-native-flash-message — 闪现消息组件
react native·react.js·harmonyos
弓.长.5 小时前
ReactNative for OpenHarmony项目鸿蒙化三方库:react-native-snap-carousel — 轮播组件
react native·react.js·harmonyos
UnicornDev5 小时前
【HarmonyOS 6】时间管理APP:时光重塑页面布局设计
华为·harmonyos·arkts·鸿蒙·鸿蒙系统
芙莉莲教你写代码5 小时前
Flutter 框架跨平台鸿蒙开发 - 科学实验指南应用
flutter·华为·harmonyos
不爱吃糖的程序媛5 小时前
Flutter鸿蒙PC应用开发实践:从零到运行
flutter·华为·harmonyos
弓.长.5 小时前
ReactNative for OpenHarmony项目鸿蒙化三方库:react-native-animatable — 动画组件
react native·react.js·harmonyos