fix(client): change toArr to _.castArray in select component (#543)
This commit is contained in:
parent
9e85116c98
commit
3e8a80a3ae
@ -1,4 +1,4 @@
|
||||
import { toArr } from '@formily/shared';
|
||||
import { castArray } from 'lodash';
|
||||
|
||||
export const defaultFieldNames = {
|
||||
label: 'label',
|
||||
@ -8,7 +8,9 @@ export const defaultFieldNames = {
|
||||
};
|
||||
|
||||
export const getCurrentOptions = (values, dataSource, fieldNames) => {
|
||||
values = toArr(values).map((val) => (typeof val === 'object' ? val[fieldNames.value] : val));
|
||||
values = castArray(values)
|
||||
.filter(item => item != null)
|
||||
.map((val) => (typeof val === 'object' ? val[fieldNames.value] : val));
|
||||
const findOptions = (options: any[]) => {
|
||||
let current = [];
|
||||
for (const option of options) {
|
||||
|
Loading…
Reference in New Issue
Block a user