@cc-component/cc-ex-component 1.7.0 → 1.7.1
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
|
@@ -63,7 +63,7 @@ interface ICollectViewEvents {
|
|
|
63
63
|
// 全局存储绑定关系: { className -> { uiProp: dataPath } }
|
|
64
64
|
const bindingMap = new Map<any, Map<string, IBindingData>>();
|
|
65
65
|
const baseData = 'viewModel'
|
|
66
|
-
const skip = "
|
|
66
|
+
const skip = "_"
|
|
67
67
|
export const refMap: Map<any, string[]> = new Map();
|
|
68
68
|
|
|
69
69
|
// const comType = {
|
|
@@ -241,6 +241,7 @@ export function ViewModel<T extends new (...args: any[]) => Component>(Base: T)
|
|
|
241
241
|
// ✅ 跳过 $ 开头的属性:不触发响应式更新
|
|
242
242
|
if (key.startsWith(skip)) {
|
|
243
243
|
target[key] = value;
|
|
244
|
+
this.refreshData(key, value)
|
|
244
245
|
return true;
|
|
245
246
|
}
|
|
246
247
|
else if (value?.skip) {
|
|
@@ -309,6 +310,9 @@ export function ViewModel<T extends new (...args: any[]) => Component>(Base: T)
|
|
|
309
310
|
this.offTouch()
|
|
310
311
|
}
|
|
311
312
|
|
|
313
|
+
refreshData(key: string, value: any) {
|
|
314
|
+
|
|
315
|
+
}
|
|
312
316
|
onTouch() {
|
|
313
317
|
const map = bindingMap.get(this.className)
|
|
314
318
|
for (const [propertyKey, value] of map) {
|