@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.
@@ -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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cc-component/cc-ex-component",
3
- "version": "1.9.3",
3
+ "version": "1.9.4",
4
4
  "engine": ">=3.8.6",
5
5
  "description": "系统组件添加常用扩展方法",
6
6
  "main": "index.ts",