@cc-component/cc-ex-component 2.1.0 → 2.1.2
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
CHANGED
|
@@ -324,7 +324,7 @@ export function ViewModel<T extends new (...args: any[]) => Component>(Base: T)
|
|
|
324
324
|
//绑定的方法
|
|
325
325
|
const funcName = bindingMapFunc.get(self.className)?.get(key)
|
|
326
326
|
if (funcName) {
|
|
327
|
-
const result = self[funcName]?.(value); // 调用函数获取返回值
|
|
327
|
+
const result = self[funcName]?.(value, false); // 调用函数获取返回值
|
|
328
328
|
// ✅ 关键:如果返回值不是 undefined,则返回计算值
|
|
329
329
|
if (result !== undefined) {
|
|
330
330
|
return result;
|
|
@@ -945,7 +945,13 @@ export class YXCollectionView extends Component {
|
|
|
945
945
|
count = this.numberOfItems
|
|
946
946
|
}
|
|
947
947
|
const layout = (this.layout as any)
|
|
948
|
-
|
|
948
|
+
|
|
949
|
+
let size: math.Size;
|
|
950
|
+
if (layout.itemSize instanceof Function) {
|
|
951
|
+
size = layout.itemSize()
|
|
952
|
+
} else {
|
|
953
|
+
size = layout.itemSize
|
|
954
|
+
}
|
|
949
955
|
const space = layout.horizontalSpacing
|
|
950
956
|
const width = size.width
|
|
951
957
|
const ut = this.node.getComponent(UITransform)
|