@cc-component/cc-ex-component 1.9.3 → 1.9.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/assets/core/ViewModel.ts +8 -3
- package/package.json +1 -1
package/assets/core/ViewModel.ts
CHANGED
|
@@ -65,7 +65,7 @@ interface ICollectViewEvents {
|
|
|
65
65
|
// 全局存储绑定关系: { className -> { uiProp: dataPath } }
|
|
66
66
|
const bindingMap = new Map<any, Map<string, IBindingData>>();
|
|
67
67
|
const baseData = 'viewModel'
|
|
68
|
-
const skip = "
|
|
68
|
+
const skip = "func"
|
|
69
69
|
export const refMap: Map<any, string[]> = new Map();
|
|
70
70
|
|
|
71
71
|
// const comType = {
|
|
@@ -317,8 +317,13 @@ export function ViewModel<T extends new (...args: any[]) => Component>(Base: T)
|
|
|
317
317
|
// this.offTouch()
|
|
318
318
|
}
|
|
319
319
|
|
|
320
|
-
refreshData(key: string, value: any) {
|
|
321
|
-
|
|
320
|
+
private refreshData(key: string, value: any) {
|
|
321
|
+
const funcName = `${key}`
|
|
322
|
+
if (this[funcName]) {
|
|
323
|
+
this[funcName]?.(value)
|
|
324
|
+
} else {
|
|
325
|
+
console.error('没有找到方法:', funcName, this.node.name)
|
|
326
|
+
}
|
|
322
327
|
}
|
|
323
328
|
|
|
324
329
|
resetButtonScale(btn: Button) {
|