From d5f2cbecc116dff3c6b601d31c568c058875da22 Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Tue, 24 Mar 2020 11:30:20 +0800 Subject: [PATCH] =?UTF-8?q?mapping=20=E7=9A=84=20key=20trim=20=E4=B8=80?= =?UTF-8?q?=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderers/Mapping.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/renderers/Mapping.tsx b/src/renderers/Mapping.tsx index 1e0832a4c..dd20c3e13 100644 --- a/src/renderers/Mapping.tsx +++ b/src/renderers/Mapping.tsx @@ -33,6 +33,7 @@ export class MappingField extends React.Component { {placeholder} ); 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['*']);