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

相关推荐
程序员黑豆30 分钟前
鸿蒙应用开发:@Link 装饰器实现父子组件双向同步
前端·后端·harmonyos
2501_919749031 小时前
华为鸿蒙免费解压缩APP—小羊解压缩
华为·harmonyos
爱写代码的森1 小时前
鸿蒙三方库 | harmony-utils之EncryptUtil URL编解码详解
服务器·华为·harmonyos·鸿蒙·huawei
youtootech2 小时前
HarmonyOS 6.0 卡片式信息流与瀑布流布局
华为·harmonyos
luoyayun3614 小时前
【Qt for Harmony】 Qt 5.12.12 鸿蒙版 Windows 交叉编译
qt·harmonyos·qt for harmony
木木子225 小时前
# 鸿蒙 HarmonyOS 应用开发实战(第25期)|骰子(Dice Roller)— Unicode 符号与动画渲染精讲
华为·harmonyos
qizayaoshuap6 小时前
# HarmonyOS ArkTS 记忆翻牌游戏深度解析 —— Fisher-Yates 洗牌与翻牌匹配机制
游戏·华为·harmonyos
youtootech6 小时前
HarmonyOS 6.0 自定义绘图表盘与仪表
华为·harmonyos
yaoyaoxingzhe17 小时前
HarmonyOS应用《玄象》开发实战:Canvas 绘制星宿连线:moveTo / lineTo / stroke 路径绘制
harmonyos·鸿蒙
echohelloworld1120 小时前
HarmonyOS应用开发实战:猫猫大作战-springMotion 三参数、responsiveSpringMotion 响应式弹簧、与 EaseO
harmonyos·鸿蒙