Tree: get prop from data if not specified in props

This commit is contained in:
Leopoldthecoder
2017-09-26 14:05:41 +08:00
committed by 杨奕
parent 2fae006ba1
commit 9e67ec3506
3 changed files with 4 additions and 3 deletions

View File

@@ -68,7 +68,8 @@ const getPropertyFromData = function(node, prop) {
} else if (typeof config === 'string') {
return data[config];
} else if (typeof config === 'undefined') {
return '';
const dataProp = data[prop];
return dataProp === undefined ? '' : dataProp;
}
};