'message' 事件


为任何传入消息触发 'message' 事件,其中包含 port.postMessage() 的克隆输入。

此事件的监听器将收到传给 postMessage()value 参数的副本,并且没有其他参数。

  • value <any> The transmitted value

The 'message' event is emitted for any incoming message, containing the cloned input of port.postMessage().

Listeners on this event will receive a clone of the value parameter as passed to postMessage() and no further arguments.