From 8c66608a8cf04795ef300877113fa7ac989ff3c1 Mon Sep 17 00:00:00 2001 From: zhangxulong Date: Thu, 28 Nov 2024 14:25:32 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E7=A7=BB=E5=8A=A8=E7=AB=AFpicker=20?= =?UTF-8?q?label=E4=B8=BA=E5=AF=B9=E8=B1=A1=E6=97=B6=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E7=99=BD=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/amis-ui/src/components/PickerColumn.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/amis-ui/src/components/PickerColumn.tsx b/packages/amis-ui/src/components/PickerColumn.tsx index 75abadc96..23357cd82 100644 --- a/packages/amis-ui/src/components/PickerColumn.tsx +++ b/packages/amis-ui/src/components/PickerColumn.tsx @@ -12,7 +12,7 @@ import React, { } from 'react'; import isObject from 'lodash/isObject'; import cloneDeep from 'lodash/cloneDeep'; -import {uncontrollable, highlight} from 'amis-core'; +import {uncontrollable, highlight, labelToString} from 'amis-core'; import {useSetState, useUpdateEffect} from '../hooks'; import {range} from 'amis-core'; @@ -96,7 +96,7 @@ const PickerColumn = forwardRef<{}, PickerColumnProps>((props, ref) => { const getOptionText = (option: [] | PickerOption) => { if (isObject(option) && labelField in option) { //@ts-ignore - return option[labelField]; + return labelToString(option[labelField]); } return option; }; From 7017f52c5e02f6c15bed28d16b3eba63c291d93d Mon Sep 17 00:00:00 2001 From: ls <1769057083@qq.com> Date: Thu, 28 Nov 2024 14:41:54 +0800 Subject: [PATCH 2/2] Update PickerColumn.tsx --- packages/amis-ui/src/components/PickerColumn.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/amis-ui/src/components/PickerColumn.tsx b/packages/amis-ui/src/components/PickerColumn.tsx index 23357cd82..69f7ff2d0 100644 --- a/packages/amis-ui/src/components/PickerColumn.tsx +++ b/packages/amis-ui/src/components/PickerColumn.tsx @@ -98,7 +98,7 @@ const PickerColumn = forwardRef<{}, PickerColumnProps>((props, ref) => { //@ts-ignore return labelToString(option[labelField]); } - return option; + return labelToString(option); }; const getOptionValue = (option: [] | PickerOption) => {