Skip to content

Commit

Permalink
fix(react-settings-form): fix typings
Browse files Browse the repository at this point in the history
  • Loading branch information
janryWang committed Nov 26, 2021
1 parent 89a1725 commit 2a837fe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,17 @@ export const BorderStyleSetter: React.FC<IBorderStyleSetterProps> = 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 (
<FoldItem label={field.title}>
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -15,7 +16,7 @@ export interface IDisplayStyleSetterProps {

export const DisplayStyleSetter: React.FC<IDisplayStyleSetterProps> = observer(
(props) => {
const field = useField<Formily.Core.Models.Field>()
const field = useField<FieldType>()
const prefix = usePrefix('display-style-setter')
return (
<>
Expand Down

0 comments on commit 2a837fe

Please sign in to comment.