mapping 的 key trim 一下

This commit is contained in:
2betop 2020-03-24 11:30:20 +08:00
parent 67c6c6f876
commit d5f2cbecc1

View File

@ -33,6 +33,7 @@ export class MappingField extends React.Component<MappingProps, object> {
<span className="text-muted">{placeholder}</span>
);
let key = value === true ? '1' : value;
key = typeof key === 'string' ? key.trim() : key; // trim 一下,干掉一些空白字符。
if (typeof value !== 'undefined' && map && (map[key] || map['*'])) {
viewValue = render('tpl', map[key] || map['*']);