@ives_xxz/framework 2.1.38 → 2.1.39

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/Framework.ts CHANGED
@@ -26,7 +26,10 @@ export class Framework implements FW.Framework {
26
26
  return this.container.get<T>(serviceIdentifier);
27
27
  }
28
28
  } else if (typeof serviceIdentifier === "function") {
29
- const className = serviceIdentifier.name;
29
+ const className =
30
+ cc.js.getClassName(serviceIdentifier) || serviceIdentifier?.name;
31
+
32
+ if (!className) return undefined;
30
33
 
31
34
  if (this.container.isBound(serviceIdentifier)) {
32
35
  return this.container.get<T>(serviceIdentifier);
@@ -48,12 +51,10 @@ export class Framework implements FW.Framework {
48
51
  const bundleName = FW.Entry.bundleName;
49
52
  const tag = suffixMap[suffix as keyof typeof suffixMap];
50
53
  const bindingKey = this.getKey(bundleName, tag);
51
-
52
54
  if (this.container.isBound(bindingKey)) {
53
55
  return this.container.get<T>(bindingKey);
54
56
  }
55
57
  }
56
-
57
58
  return this.getComponents(serviceIdentifier)[0];
58
59
  }
59
60
  }
package/FrameworkBase.ts CHANGED
@@ -69,31 +69,31 @@ export abstract class FrameworkBase {
69
69
  const tag = this.getClassTag();
70
70
 
71
71
  if (tag !== FW.SystemDefine.FWBindTag.LOGIC) {
72
- this.logic = FW.Framework.getComponent<FW.Logic>(
72
+ this.logic = FW.Entry.getComponent<FW.Logic>(
73
73
  `${bundleName}${FW.SystemDefine.FWBindTag.LOGIC}`,
74
74
  );
75
75
  }
76
76
 
77
77
  if (tag !== FW.SystemDefine.FWBindTag.DATA) {
78
- this.data = FW.Framework.getComponent<FW.Data>(
78
+ this.data = FW.Entry.getComponent<FW.Data>(
79
79
  `${bundleName}${FW.SystemDefine.FWBindTag.DATA}`,
80
80
  );
81
81
  }
82
82
 
83
83
  if (tag !== FW.SystemDefine.FWBindTag.CONFIG) {
84
- this.config = FW.Framework.getComponent<FW.AssetConfig>(
84
+ this.config = FW.Entry.getComponent<FW.AssetConfig>(
85
85
  `${bundleName}${FW.SystemDefine.FWBindTag.CONFIG}`,
86
86
  );
87
87
  }
88
88
 
89
89
  if (tag !== FW.SystemDefine.FWBindTag.SENDER) {
90
- this.sender = FW.Framework.getComponent<FW.Sender>(
90
+ this.sender = FW.Entry.getComponent<FW.Sender>(
91
91
  `${bundleName}${FW.SystemDefine.FWBindTag.SENDER}`,
92
92
  );
93
93
  }
94
94
 
95
95
  if (tag !== FW.SystemDefine.FWBindTag.HANDLE) {
96
- this.handle = FW.Framework.getComponent<FW.Handle>(
96
+ this.handle = FW.Entry.getComponent<FW.Handle>(
97
97
  `${bundleName}${FW.SystemDefine.FWBindTag.HANDLE}`,
98
98
  );
99
99
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ives_xxz/framework",
3
- "version": "2.1.38",
3
+ "version": "2.1.39",
4
4
  "description": "cocoscreator 2.x mvc framework",
5
5
  "main": "index.js",
6
6
  "keywords": [