fast-vue-multi-pages-vite 1.3.2 → 1.3.4

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.
package/dist/index.d.ts CHANGED
@@ -928,6 +928,13 @@ declare class FastVueNative {
928
928
  * @private
929
929
  */
930
930
  private static doAppCallBack;
931
+ /**
932
+ * 运行window方法,将穿透到iframe中
933
+ * @param functionName
934
+ * @param args
935
+ * @private
936
+ */
937
+ private static runFunction;
931
938
  /**
932
939
  * 手机原生方法回执时调用
933
940
  * @param key 回调函数的唯一标识
package/dist/index.js CHANGED
@@ -413,6 +413,9 @@ var FastVueMultiUUID = class FastVueMultiUUID {
413
413
  * 执行本地方法核心类
414
414
  */
415
415
  var FastVueNative = class FastVueNative {
416
+ static {
417
+ FastVueNative.injectAppJsForNativeCall(window);
418
+ }
416
419
  static getKey() {
417
420
  return "AppCallback" + FastVueMultiUUID.buildUUID_V6();
418
421
  }
@@ -458,7 +461,6 @@ var FastVueNative = class FastVueNative {
458
461
  * @param callBack 回调函数
459
462
  */
460
463
  static execute(methodName, methodParams, callBack) {
461
- this.injectAppJsForNativeCall(window);
462
464
  const key = this.getKey();
463
465
  try {
464
466
  if (methodParams == null) methodParams = [];
@@ -521,6 +523,21 @@ var FastVueNative = class FastVueNative {
521
523
  for (let i = 0; i < targetWindow.length; i++) this.doAppCallBack(targetWindow[i], key, result);
522
524
  }
523
525
  /**
526
+ * 运行window方法,将穿透到iframe中
527
+ * @param functionName
528
+ * @param args
529
+ * @private
530
+ */
531
+ static runFunction(functionName, ...args) {
532
+ let doRunFunction = function(targetWindow) {
533
+ try {
534
+ if (targetWindow[functionName]) targetWindow[functionName](...args);
535
+ } catch (e) {}
536
+ for (let i = 0; i < targetWindow.length; i++) doRunFunction(targetWindow[i]);
537
+ };
538
+ doRunFunction(window);
539
+ }
540
+ /**
524
541
  * 手机原生方法回执时调用
525
542
  * @param key 回调函数的唯一标识
526
543
  * @param result 回调结果
@@ -1187,10 +1204,10 @@ var FastVueMultiTimeout = class FastVueMultiTimeout {
1187
1204
  window["TimeoutFlag" + code] = true;
1188
1205
  window["Timeout" + code] = setTimeout(() => {
1189
1206
  if (!window["TimeoutFlag" + code]) return;
1207
+ FastVueMultiTimeout.stopTimeout(code);
1190
1208
  if (callback) callback({ isStopped: () => {
1191
1209
  return window["TimeoutFlag" + code];
1192
1210
  } });
1193
- FastVueMultiTimeout.stopTimeout(code);
1194
1211
  }, duration);
1195
1212
  }
1196
1213
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fast-vue-multi-pages-vite",
3
- "version": "1.3.2",
3
+ "version": "1.3.4",
4
4
  "author": "janesen",
5
5
  "description": "Vite-快速搭建VUE项目工具类的基本库,主要用于多个页面独立生成html",
6
6
  "main": "./dist/index.js",
package/vite/index.js CHANGED
@@ -818,9 +818,10 @@ var FastViteTemplate = class {
818
818
  };
819
819
 
820
820
  const setWindowValue=(obj,attr,value)=>{
821
- try { if(obj){
822
- obj[attr]=value
823
- }
821
+ try {
822
+ if(obj){
823
+ obj[attr]=value
824
+ }
824
825
  } catch(e) { }
825
826
  for(let i = 0; i < obj.length; i++) {
826
827
  setWindowValue(obj[i],attr,value)