mirror of https://github.com/ElemeFE/element
Table: add value as formatter parameter (#5709)
* 添加接口计算原来的列值 * export old value of column in formatter function * Update table-column.js * Update table-column.jspull/5577/merge
parent
b1c67d51a7
commit
92d6008802
|
@ -97,15 +97,13 @@ const getDefaultColumn = function(type, options) {
|
||||||
|
|
||||||
const DEFAULT_RENDER_CELL = function(h, { row, column }) {
|
const DEFAULT_RENDER_CELL = function(h, { row, column }) {
|
||||||
const property = column.property;
|
const property = column.property;
|
||||||
|
const value = property && property.indexOf('.') === -1
|
||||||
|
? row[property]
|
||||||
|
: getValueByPath(row, property);
|
||||||
if (column && column.formatter) {
|
if (column && column.formatter) {
|
||||||
return column.formatter(row, column);
|
return column.formatter(row, column, value);
|
||||||
}
|
}
|
||||||
|
return value;
|
||||||
if (property && property.indexOf('.') === -1) {
|
|
||||||
return row[property];
|
|
||||||
}
|
|
||||||
|
|
||||||
return getValueByPath(row, property);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
Loading…
Reference in New Issue