HarmonyOS ArrayList 遇到问题?

Error message:The forEach method cannot be bound, 调用的对象是ArrayList

export class LUBCUAAgreementInfo {
  id?: number
  type?: string
}

export class LUBCUAUnifyAuthSceneInfoResult {
  id?: number
  sceneCode?: string
  agreementInfoDTOS?: ArrayList<LUBCUAAgreementInfo>
}

调用代码

@Component
export struct LUBCUALoginView {
  @Prop agreementData?: LUBCUAUnifyAuthSceneInfoResult

  aboutToAppear(): void {
    this.agreementData?.agreementInfoDTOS?.forEach((value: LUBCUAAgreementInfo, index: number) => {

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