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

相关推荐
松叶似针20 小时前
Flutter三方库适配OpenHarmony【doc_text】— Dart 层架构与 Platform Interface 模式解析
flutter·harmonyos
星空22231 天前
【HarmonyOS】day45:RN_of_HarmonyOS实战项目_密码显示隐藏
华为·harmonyos
anyup1 天前
uniapp开发的鸿蒙应用上架后,竟然月入4000+
前端·vue.js·harmonyos
松叶似针1 天前
Flutter三方库适配OpenHarmony【doc_text】— .docx 解析全流程:从 ZIP 解压到 XML 提取
xml·flutter·harmonyos
星空22231 天前
【HarmonyOS】RN_of_HarmonyOS实战项目:TextInput表情符号输入
华为·harmonyos
浩宇软件开发1 天前
基于DevEco鸿蒙开垃圾分类APP实现
harmonyos·arkts·arkui·垃圾分类·鸿蒙开发·deveco
钟睿1 天前
HarmonyOS花瓣地图自定义点聚合功能
android·harmonyos·arkts
星空22231 天前
鸿蒙跨平台实战day47:React Native在OpenHarmony上的Font自定义字体注册详解
react native·华为·harmonyos
阿林来了1 天前
Flutter三方库适配OpenHarmony【flutter_web_auth】— OpenHarmony 插件工程搭建与配置文件详解
flutter·harmonyos
早點睡3901 天前
Flutter for Harmony 跨平台开发实战:鸿蒙与音乐律动艺术、FFT 频谱能量场:正弦函数的叠加艺术
flutter·华为·harmonyos