emitCustomSystemEvent
API_LEVEL
3.0开始支持,API 兼容性请参考 API_LEVEL。
小程序可以自定义系统事件,并可以主动派发该自定义系统事件。
类型
function emitCustomSystemEvent(option: Option): void
参数
Option
| 属性 | 类型 | 必填 | 默认值 | 说明 | API_LEVEL |
|---|---|---|---|---|---|
| eventName | string | 是 | - | 自定义事件名称,需要满足 event.customize.${event} 的命名约定 | 3.0 |
| eventParam | string | 是 | - | 自定义事件参数 | 3.0 |
代码示例
import { emitCustomSystemEvent } from '@zos/app'
emitCustomSystemEvent('event.customize.test')