mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
Merge pull request #11281 from z1769057083/master
fix: 移动端picker label为对象时页面白屏
This commit is contained in:
commit
04c1e07fd9
@ -12,7 +12,7 @@ import React, {
|
|||||||
} from 'react';
|
} from 'react';
|
||||||
import isObject from 'lodash/isObject';
|
import isObject from 'lodash/isObject';
|
||||||
import cloneDeep from 'lodash/cloneDeep';
|
import cloneDeep from 'lodash/cloneDeep';
|
||||||
import {uncontrollable, highlight} from 'amis-core';
|
import {uncontrollable, highlight, labelToString} from 'amis-core';
|
||||||
|
|
||||||
import {useSetState, useUpdateEffect} from '../hooks';
|
import {useSetState, useUpdateEffect} from '../hooks';
|
||||||
import {range} from 'amis-core';
|
import {range} from 'amis-core';
|
||||||
@ -96,9 +96,9 @@ const PickerColumn = forwardRef<{}, PickerColumnProps>((props, ref) => {
|
|||||||
const getOptionText = (option: [] | PickerOption) => {
|
const getOptionText = (option: [] | PickerOption) => {
|
||||||
if (isObject(option) && labelField in option) {
|
if (isObject(option) && labelField in option) {
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
return option[labelField];
|
return labelToString(option[labelField]);
|
||||||
}
|
}
|
||||||
return option;
|
return labelToString(option);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getOptionValue = (option: [] | PickerOption) => {
|
const getOptionValue = (option: [] | PickerOption) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user