@cc-component/cc-ex-component 1.5.7 → 1.5.8

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.
@@ -83,6 +83,7 @@ export class ReferenceComponent extends Component {
83
83
  comList = ["EditBox", "Toggle", "ToggleContainer", "Slider", "Button", "ProgressBar", "YXCollectionView", "TableView"]
84
84
  comList2 = ["YXCollectionView", "TableView"]
85
85
  comList_base = ["EditBox", "Toggle", "ToggleContainer", "Slider", "Button", "ProgressBar"]
86
+ comListAll = ["EditBox", "Toggle", "ToggleContainer", "Slider", "Button", "ProgressBar", "ScrollView", "PageView", "Animation", 'Sprite', 'Label', 'RichText', 'ParticleSystem2D', 'Skeleton']
86
87
 
87
88
  /** 生成代码基础窗口名称 */
88
89
  public baseWindowName = "BaseWindow"
@@ -257,7 +258,7 @@ export class ReferenceComponent extends Component {
257
258
 
258
259
 
259
260
  let bind = `${bind_pix}("${name}"${this.comList2.includes(type) ? event : ""})`
260
- if (this.skipList.includes(type)) {
261
+ if (this.skipList.includes(type) || !this.comListAll.includes(type)) {
261
262
  bind = `${bind_pix}()`
262
263
  }
263
264
 
@@ -303,7 +304,7 @@ export class ReferenceComponent extends Component {
303
304
  let key = data.key;
304
305
  let name = key[0].toLowerCase() + key.substring(1);
305
306
  const type = this.getPropertyType(data.com)
306
- if (!this.skipList.includes(type)) {
307
+ if ((this.comListAll.includes(type) && !this.skipList.includes(type))) {
307
308
  //@ts-ignore
308
309
  let line = ` ${name}: ${this.getDataTypeByComponentType(type)};`//`private get ${name}() { return this.rc.get("${key}", ${this.getPropertyType(data.node)}); }`;
309
310
  sx += line + "" + (index < this.nodes.length - 1 ? "\n" : "");
@@ -419,8 +420,8 @@ export class ${className}Window extends ViewModel(${this.baseWindowName}) {${sx.
419
420
  if (node.getComponent("cc.RichText")) return "RichText";
420
421
  if (node.getComponent("cc.ParticleSystem2D")) return "ParticleSystem2D";
421
422
  if (node.getComponent("sp.Skeleton")) return "sp.Skeleton";
422
-
423
- return "Node";
423
+ const com = node.getComponentsInChildren(Component).pop()
424
+ return js.getClassName(com).replace('cc.', '');
424
425
  }
425
426
 
426
427
  getDataTypeByComponentType(compType: string) {
@@ -217,6 +217,7 @@ export function ViewModel<T extends new (...args: any[]) => Component>(Base: T)
217
217
  is_load_sub?: boolean;
218
218
  /**是否记录-不记录可重复打开窗口 */
219
219
  is_record?: boolean;
220
+ name_ui: string;
220
221
  };
221
222
  // 创建响应式数据
222
223
  _makeReactive<T extends object>(obj: T, pathPrefix: string): T {
@@ -697,7 +698,8 @@ function updateStatus(data: IBindingData, com: Component, value: any, self: any)
697
698
  }
698
699
  break;
699
700
  default: {
700
- if (com) console.error(`请检查类型: ${data.type}`);
701
+ // if (com) console.error(`请检查类型: ${data.type}`);
702
+ break
701
703
  }
702
704
  }
703
705
 
@@ -40,6 +40,7 @@ declare global {
40
40
  path: string,
41
41
  bundle: string,
42
42
  name?: string,/**窗口名称 */
43
+ name_ui?: string,/**窗口名称 */
43
44
  index?: number,
44
45
  is_load_sub?: boolean,
45
46
  /**是否记录-不记录可重复打开窗口 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cc-component/cc-ex-component",
3
- "version": "1.5.7",
3
+ "version": "1.5.8",
4
4
  "engine": ">=3.8.6",
5
5
  "description": "系统组件添加常用扩展方法",
6
6
  "main": "index.ts",