@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.
- package/assets/core/ViewModel.ts +5 -1
- package/package.json +1 -1
package/assets/core/ViewModel.ts
CHANGED
|
@@ -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
|
|
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
|