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

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

阅读 467
1 个回答

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

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

aboutToAppear(): void {
  let storageProcess = LocalStorage.getShared()
  let a = storageProcess.get("storageSimpleProp") as number
  console.log("success" + a);
}