Home > PCB_Event > addNetEventListener
PCB_Event.addNetEventListener() method
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
新增网络事件监听
Signature
typescript
addNetEventListener(id: string, eventType: 'all' | EPCB_NetEventType, callFn: (eventType: EPCB_NetEventType, props: [{
net: string;
}]) => void | Promise<void>, onlyOnce?: boolean): void;1
2
3
2
3
Parameters
Parameter | Type | Description |
|---|---|---|
id | string | 事件 ID,用以防止重复注册事件 |
eventType | 'all' | EPCB_NetEventType | 事件类型 |
callFn | (eventType: EPCB_NetEventType, props: [{ net: string; }]) => void | Promise<void> | 事件触发时的回调函数 |
onlyOnce | boolean | (Optional) 是否仅监听一次 |
Returns
void
Remarks
网络选中事件仅
①在过滤面板选中网络选项并在画布选中网络时
②在工程设计 -> 网络内选中网络时
会被触发
注意:本接口仅扩展有效,在独立脚本环境内调用将始终 throw Error