Table: add value as formatter parameter (#5709)

* 添加接口计算原来的列值

* export old value of column in formatter function

* Update table-column.js

* Update table-column.js
pull/5577/merge
helondeng 2017-07-15 17:00:36 +08:00 committed by 杨奕
parent b1c67d51a7
commit 92d6008802
1 changed files with 5 additions and 7 deletions

View File

@ -97,15 +97,13 @@ const getDefaultColumn = function(type, options) {
const DEFAULT_RENDER_CELL = function(h, { row, column }) {
const property = column.property;
const value = property && property.indexOf('.') === -1
? row[property]
: getValueByPath(row, property);
if (column && column.formatter) {
return column.formatter(row, column);
return column.formatter(row, column, value);
}
if (property && property.indexOf('.') === -1) {
return row[property];
}
return getValueByPath(row, property);
return value;
};
export default {