HarmonyOS State的变量无法监听到值的变化?

ILoginUiService.instance()?.getAccountSelectComponent().builder({
  visible: this.param.visible
})

@State param: AccountDialogData = new AccountDialogData();
@Observed
export class AccountDialogData {
  visible: boolean = false;
}

getAccountSelectComponent(): WrappedBuilder<[AccountDialogData]> {
  return wrapBuilder(AccountSelectComponentBuilder)
}
}

@Builder
function AccountSelectComponentBuilder(accountDialogData: AccountDialogData) {
  AccountSelectMiddleView({ accountDialogData: accountDialogData });
}

在AccountSelectMiddleView中无法监听到AccountDialogData.visible.的变化?请问是哪里弄错了。

阅读 689
1 个回答
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进