fast-vue-multi-pages 1.1.0 → 1.1.1

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.
@@ -9,6 +9,11 @@ export declare class FastVueNative {
9
9
  private static methodInfos;
10
10
  private static getKey;
11
11
  private static showError;
12
+ /**
13
+ * 注册js函数到window对象中,以供客户端调用
14
+ * @private
15
+ */
16
+ private static injectAppJsForNativeCall;
12
17
  /**
13
18
  * 是否是安卓客户端
14
19
  */
@@ -23,6 +23,15 @@ class FastVueNative {
23
23
  static showError(message) {
24
24
  alert("FastAppJs发生错误:" + message);
25
25
  }
26
+ /**
27
+ * 注册js函数到window对象中,以供客户端调用
28
+ * @private
29
+ */
30
+ static injectAppJsForNativeCall() {
31
+ if (!(window["appJs"])) {
32
+ window["appJs"] = FastVueNative;
33
+ }
34
+ }
26
35
  /**
27
36
  * 是否是安卓客户端
28
37
  */
@@ -42,6 +51,7 @@ class FastVueNative {
42
51
  * @param callBack 回调函数
43
52
  */
44
53
  static execute(methodName, methodParams, callBack) {
54
+ this.injectAppJsForNativeCall();
45
55
  const Base64 = require("js-base64");
46
56
  const key = this.getKey();
47
57
  try {
@@ -9,6 +9,11 @@ export declare class FastVueNative {
9
9
  private static methodInfos;
10
10
  private static getKey;
11
11
  private static showError;
12
+ /**
13
+ * 注册js函数到window对象中,以供客户端调用
14
+ * @private
15
+ */
16
+ private static injectAppJsForNativeCall;
12
17
  /**
13
18
  * 是否是安卓客户端
14
19
  */
@@ -23,6 +23,15 @@ define(["require", "exports", "tslib", "../other/FastVueMultiObject", "../other/
23
23
  FastVueNative.showError = function (message) {
24
24
  alert("FastAppJs发生错误:" + message);
25
25
  };
26
+ /**
27
+ * 注册js函数到window对象中,以供客户端调用
28
+ * @private
29
+ */
30
+ FastVueNative.injectAppJsForNativeCall = function () {
31
+ if (!(window["appJs"])) {
32
+ window["appJs"] = FastVueNative;
33
+ }
34
+ };
26
35
  /**
27
36
  * 是否是安卓客户端
28
37
  */
@@ -42,6 +51,7 @@ define(["require", "exports", "tslib", "../other/FastVueMultiObject", "../other/
42
51
  * @param callBack 回调函数
43
52
  */
44
53
  FastVueNative.execute = function (methodName, methodParams, callBack) {
54
+ this.injectAppJsForNativeCall();
45
55
  var Base64 = require("js-base64");
46
56
  var key = this.getKey();
47
57
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fast-vue-multi-pages",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "author": "janesen",
5
5
  "description": "快速搭建VUE项目工具类的基本库,主要用于每个功能页面独立生成html",
6
6
  "main": "./dist/cjs/index.js",