From e318252fa11d95110632b4bff63750df4c8c0a8d Mon Sep 17 00:00:00 2001 From: ls <1769057083@qq.com> Date: Mon, 2 Dec 2024 11:21:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E5=8A=A8=E7=AB=AFpicker=20labe?= =?UTF-8?q?l=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=20(#11299)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 移动端picker label为对象时页面白屏 * Update PickerColumn.tsx --------- Co-authored-by: zhangxulong --- packages/amis-ui/src/components/PickerColumn.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/amis-ui/src/components/PickerColumn.tsx b/packages/amis-ui/src/components/PickerColumn.tsx index 75abadc9606..69f7ff2d068 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,9 +96,9 @@ 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; + return labelToString(option); }; const getOptionValue = (option: [] | PickerOption) => {