From 211d2bda781304bcd5a3ccc928e22f40397e873f Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Wed, 13 Apr 2022 14:52:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=89=E4=B8=AA=E5=8F=AF=E8=83=BD=20valueFie?= =?UTF-8?q?ld=20=E6=B2=A1=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Select.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/Select.tsx b/src/components/Select.tsx index 249a3f615..1a7c39f75 100644 --- a/src/components/Select.tsx +++ b/src/components/Select.tsx @@ -114,7 +114,7 @@ export function value2array( return value .map((value: any) => expandValue(value, props.options, props.valueField) || - (isObject(value) && value.hasOwnProperty(props.valueField)) + (isObject(value) && value.hasOwnProperty(props.valueField || 'value')) ? value : undefined ) @@ -130,7 +130,8 @@ export function value2array( ); return expandedValue ? [expandedValue] - : isObject(value) && (value as Option).hasOwnProperty(props.valueField) + : isObject(value) && + (value as Option).hasOwnProperty(props.valueField || 'value') ? [value as Option] : []; }