HarmonyOS 应用接续之后如何在Component中取到传过来的数据?

如题:HarmonyOS 应用接续之后如何在Component中取到传过来的数据?

阅读 466
1 个回答

您可以将want的参数传入到onWindowStageCreate中,在load页面时将参数作为参数传进去

页面可以通过下面方式获取:

aboutToAppear(): void {
  let storageProcess = LocalStorage.getShared()
  let a = storageProcess.get("storageSimpleProp") as number
  console.log("success" + a);
}
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进