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

相关推荐
哈哈你是真的厉害21 分钟前
小白基础入门 React Native 鸿蒙跨平台开发:实现一个简单的个人所得税计算器
react native·react.js·harmonyos
小白阿龙1 小时前
鸿蒙+flutter 跨平台开发——汇率查询器开发实战
flutter·华为·harmonyos·鸿蒙
哈哈你是真的厉害1 小时前
小白基础入门 React Native 鸿蒙跨平台开发:二维码生成工具(通过生成网址生成)
react native·react.js·harmonyos
HMS Core2 小时前
【FAQ】HarmonyOS SDK 闭源开放能力 — Media Kit
华为·harmonyos
2501_944526422 小时前
Flutter for OpenHarmony 万能游戏库App实战 - 设置功能实现
android·javascript·flutter·游戏·harmonyos
2501_944424123 小时前
Flutter for OpenHarmony游戏集合App实战之记忆翻牌表情图案
开发语言·javascript·flutter·游戏·harmonyos
2501_944424123 小时前
Flutter for OpenHarmony游戏集合App实战之数字拼图打乱排列
android·开发语言·flutter·游戏·harmonyos
2501_944526424 小时前
Flutter for OpenHarmony 万能游戏库App实战 - 知识问答游戏实现
android·开发语言·javascript·python·flutter·游戏·harmonyos
2501_944424124 小时前
Flutter for OpenHarmony游戏集合App实战之数字拼图滑动交换
android·开发语言·flutter·游戏·harmonyos
不会写代码0005 小时前
Flutter 框架跨平台鸿蒙开发 - 手写笔记工具开发教程
笔记·flutter·华为·harmonyos