diff --git a/packages/react-settings-form/src/components/BorderStyleSetter/index.tsx b/packages/react-settings-form/src/components/BorderStyleSetter/index.tsx index 7e97edf7e..73b8aa980 100644 --- a/packages/react-settings-form/src/components/BorderStyleSetter/index.tsx +++ b/packages/react-settings-form/src/components/BorderStyleSetter/index.tsx @@ -71,19 +71,17 @@ export const BorderStyleSetter: React.FC = observer( [field.value] ) const prefix = usePrefix('border-style-setter') - const createReaction = - (position: string) => (field: Formily.Core.Models.Field) => { - field.display = - currentPosition.value === position ? 'visible' : 'hidden' - if (position !== 'center') { - const borderStyle = field.query('.borderStyle').value() - const borderWidth = field.query('.borderWidth').value() - const borderColor = field.query('.borderColor').value() - if (borderStyle || borderWidth || borderColor) { - field.value = undefined - } + const createReaction = (position: string) => (field: FieldType) => { + field.display = currentPosition.value === position ? 'visible' : 'hidden' + if (position !== 'center') { + const borderStyle = field.query('.borderStyle').value() + const borderWidth = field.query('.borderWidth').value() + const borderColor = field.query('.borderColor').value() + if (borderStyle || borderWidth || borderColor) { + field.value = undefined } } + } return ( diff --git a/packages/react-settings-form/src/components/DisplayStyleSetter/index.tsx b/packages/react-settings-form/src/components/DisplayStyleSetter/index.tsx index 834f7af79..2deb0884e 100644 --- a/packages/react-settings-form/src/components/DisplayStyleSetter/index.tsx +++ b/packages/react-settings-form/src/components/DisplayStyleSetter/index.tsx @@ -1,5 +1,6 @@ import React from 'react' import { useField, Field, observer } from '@formily/react' +import { Field as FieldType } from '@formily/core' import { FormItem } from '@formily/antd' import { Radio } from 'antd' import { usePrefix, IconWidget } from '@designable/react' @@ -15,7 +16,7 @@ export interface IDisplayStyleSetterProps { export const DisplayStyleSetter: React.FC = observer( (props) => { - const field = useField() + const field = useField() const prefix = usePrefix('display-style-setter') return ( <>