diff --git a/packages/core/client/src/schema-settings/VariableInput/hooks/useFormVariable.ts b/packages/core/client/src/schema-settings/VariableInput/hooks/useFormVariable.ts index 00ba7de2c2..95b7573f32 100644 --- a/packages/core/client/src/schema-settings/VariableInput/hooks/useFormVariable.ts +++ b/packages/core/client/src/schema-settings/VariableInput/hooks/useFormVariable.ts @@ -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'], }; }