Merge pull request #155 from yexk/master

【进阶->国际化】文档 & 修复needTotal计算问题
This commit is contained in:
iczer
2020-12-06 10:28:08 +08:00
committed by GitHub
2 changed files with 207 additions and 2 deletions

View File

@@ -95,7 +95,14 @@ export default {
return {
...item,
total: selectedRows.reduce((sum, val) => {
return sum + val[item.dataIndex]
let v
try{
v = val[item.index] ? val[item.index] : eval(`val.${item.dataIndex}`);
}catch(_){
v = val[item.index];
}
v = !isNaN(parseFloat(v)) ? parseFloat(v) : 0;
return sum + v
}, 0)
}
})