fix: add new collection linakge disabled (#2198)

This commit is contained in:
katherinehhh 2023-07-06 23:13:02 +08:00 committed by GitHub
parent f567f887de
commit 5a8f3d1ae3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,7 @@
import { useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { useCompile, useGetFilterOptions } from '../../../schema-component';
import { FieldOption, Option } from '../type';
import { useTranslation } from 'react-i18next';
interface GetOptionsParams {
depth: number;
@ -27,7 +27,7 @@ const getChildren = (
label: compile(option.title),
depth,
// TODO: 现在是通过组件的名称来过滤能够被选择的选项,这样的坏处是不够精确,后续可以优化
disabled: schema?.['x-component'] !== option.schema?.['x-component'],
disabled: schema && schema?.['x-component'] !== option.schema?.['x-component'],
};
}