@uone/u-pm
v1.1.7
Published
单点系统 postmessage
Downloads
1
Readme
@uone/u-pm
TODO: description
Usage
import WebPostMessage from '@uone/u-pm'
// 假设 A 组件 传信息给 B组件
// A
new WebPostMessage({
childrenURL: 'http://localhost:9092', // b地址
message: {
Authorization: sessionStorage.getItem('Authorization'),
parentURL: location.origin // parenturl 代表当前地址,a地
}
}).pub()
// B 接受方
new WebPostMessage().sub(e => {
console.log(e)
})