mapping 的 key trim 一下

This commit is contained in:
2betop 2020-03-24 11:30:20 +08:00
parent 6b930a74fd
commit d87d2eab7f
1 changed files with 1 additions and 0 deletions

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['*']);