📝 示例代码
父页面
const channel = new IframeChannel(iframe)
const response = await channel.publish(
'greeting',
{ message: 'Hello!' }
)
console.log(response.data)
channel.subscribe('notify', ({ data }) => {
console.log('收到:', data)
return { received: true }
})