处理 js reduce 初始值问题
This commit is contained in:
@@ -127,7 +127,7 @@ patch(ListRenderer.prototype, {
|
||||
}
|
||||
if (["float", "int", "monetary"].includes(fieldInfo.type)) {
|
||||
const fieldValues = values.map((v) => v[fieldInfo.name] || 0);
|
||||
const aggregateValue = fieldValues.reduce((acc, val) => acc + val);
|
||||
const aggregateValue = fieldValues.reduce((acc, val) => acc + val, 0);
|
||||
if (!aggregateValue) {
|
||||
console.log(column)
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user