Skip to content

Commit

Permalink
fix: prop "scope" of SchemaField not work with reactions
Browse files Browse the repository at this point in the history
  • Loading branch information
MisicDemone committed Aug 9, 2021
1 parent 4118b8d commit 9398c2a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/vue/src/components/RecursionField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ const RecursionField = observer(
const createSchema = (schemaProp: IRecursionFieldProps['schema']) =>
new Schema(schemaProp)
const createFieldSchema = (schema: Schema) =>
schema.compile?.({
...optionsRef.value.scope,
...scopeRef.value,
})
schema.compile?.(scopeRef.value)
const schemaRef = shallowRef(createSchema(props.schema))
const fieldSchemaRef = shallowRef(createFieldSchema(schemaRef.value))
watch([() => props.schema, scopeRef, optionsRef], () => {
Expand All @@ -69,7 +66,7 @@ const RecursionField = observer(
})

const getPropsFromSchema = (schema: Schema) =>
schema?.toFieldProps?.(optionsRef.value)
schema?.toFieldProps?.({ ...optionsRef.value, scope: scopeRef.value })
const fieldPropsRef = shallowRef(getPropsFromSchema(fieldSchemaRef.value))
watch([fieldSchemaRef, optionsRef], () => {
fieldPropsRef.value = getPropsFromSchema(fieldSchemaRef.value)
Expand Down

0 comments on commit 9398c2a

Please sign in to comment.