xctc-utils 1.6.40 → 1.6.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,7 +15,7 @@ export declare const updateIframeReceiveData: (cb: any) => void;
15
15
  * 子应用 获取到 主应用 传递的数据
16
16
  * @param cb
17
17
  */
18
- export declare const updateParentReceiveData: (cb: any, window: any) => void;
18
+ export declare const updateParentReceiveData: (cb: any) => void;
19
19
  /**
20
20
  * 子应用frame 发送数据 到主应用
21
21
  * @param sendData
@@ -73,8 +73,7 @@ exports.updateIframeReceiveData = updateIframeReceiveData;
73
73
  * 子应用 获取到 主应用 传递的数据
74
74
  * @param cb
75
75
  */
76
- var updateParentReceiveData = function (cb, window) {
77
- var win = window;
76
+ var updateParentReceiveData = function (cb) {
78
77
  win.addEventListener('message', function (event) {
79
78
  var data = event.data;
80
79
  var mainData = (0, utils_1.isJson)(data);
@@ -129,7 +128,7 @@ var sendParentMessage = function (id, data) {
129
128
  iframe.addEventListener('load', function () {
130
129
  // iFrame加载完成后的操作
131
130
  iframe.contentWindow.postMessage(JSON.stringify(data), iframe.src);
132
- });
131
+ }, false);
133
132
  }
134
133
  else {
135
134
  console.error("传递的数据仅支持对象格式!");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xctc-utils",
3
- "version": "1.6.40",
3
+ "version": "1.6.42",
4
4
  "description": "localStorage存储\r ```\r sessionStorage存储\r ```\r crypto-js加密、解密\r ```\r 微信授权登录、微信分享\r ```\r 设备环境获取\r ```\r 是否是微信浏览器\r ```\r 时间戳转时间,字符串转时间戳",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",