shm-iframe-rpc
v2.0.7
Published
``` parent.html comlinExpose({ getUserInfo: () => ({ id: 123, name: 'ryan' }), }, document.getElementById('iframe').contentWindow); ```
Downloads
11
Readme
使用
parent.html
comlinExpose({
getUserInfo: () => ({ id: 123, name: 'ryan' }),
}, document.getElementById('iframe').contentWindow);
iframe.html
rpc.getUserInfo().then((user) => {
console.log(user);
});