@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
|
|
423
|
+
const com = node.getComponentsInChildren(Component).pop()
|
|
424
|
+
return js.getClassName(com).replace('cc.', '');
|
|
424
425
|
}
|
|
425
426
|
|
|
426
427
|
getDataTypeByComponentType(compType: string) {
|
package/assets/core/ViewModel.ts
CHANGED
|
@@ -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
|
|