openharmony 鸿蒙 js-apis-inner-commonEvent-commonEventData

2025-06-12 浏览 (1)

CommonEventData

表示公共事件的数据。

说明:

本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。

属性

原子化服务API: 从API version 11开始,该接口支持在原子化服务中使用。

系统能力: SystemCapability.Notification.CommonEvent

名称类型只读可选说明
eventstring表示当前接收的公共事件名称。
bundleNamestring表示包名称,当前默认为空。
codenumber表示订阅者接收到的公共事件数据(number类型)。该字段取值与发布者使用commonEventManager.publish发布公共事件时,通过CommonEventPublishData中的code字段传递的数据一致。默认值为0。
datastring表示订阅者接收到的公共事件数据(string类型)。该字段取值与发布者使用commonEventManager.publish发布公共事件时,通过CommonEventPublishData中的data字段传递的数据一致。
parameters{[key: string]: any}表示订阅者接收到的公共事件的附加信息。该字段取值与发布者使用commonEventManager.publish发布公共事件时,通过CommonEventPublishData中的parameters字段传递的数据一致。

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Basic Services Kit(基础服务)

harmony 鸿蒙DeviceInfo

harmony 鸿蒙OH_Print

harmony 鸿蒙Print_Margin

harmony 鸿蒙Print_PageSize

harmony 鸿蒙Print_PrintAttributes

harmony 鸿蒙Print_PrintDocCallback

harmony 鸿蒙Print_Range

harmony 鸿蒙TimeService

harmony 鸿蒙ohscan.h

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/wlE8Mt