window.emitter.emit('sayHello', {
name: "Bill Gates",
value: "亿万富翁"
})
window.emitter.on('echo', (data)=>{
console.log("对方的响应: ",data.result, data.gift)
}
window.emitter.on('sayHello', (data)=>{
console.log("Hello",data.name, data.value)
window.emitter.emit('echo',{
result: "成功",
gift: "Kiss"
})
);