@cc-component/cc-ex-component 2.0.2 → 2.0.3

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.
@@ -185,7 +185,11 @@ export function BindFunc(path?: string) {
185
185
  /**绑定自定义viewModel */
186
186
  export function BindData(viewName?: string) {
187
187
  return function (target: any, propertyKey: string) {
188
- const viewClassName = viewName ? viewName : propertyKey
188
+ const call = () => {
189
+ if (!propertyKey.endsWith('Data')) { console.error('属性名称 必须以Data结尾', propertyKey) }
190
+ return propertyKey.replace('Data', '')
191
+ }
192
+ const viewClassName = viewName ? viewName : call()
189
193
  const className = target.constructor
190
194
  if (!bindingMapView.has(viewClassName)) { bindingMapView.set(viewClassName, { key: '', manager: null }); }
191
195
  bindingMapView.get(viewClassName)!.key = propertyKey
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cc-component/cc-ex-component",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "engine": ">=3.8.6",
5
5
  "description": "系统组件添加常用扩展方法",
6
6
  "main": "index.ts",