Skip to content

Commit

Permalink
fix: unwrap flags before sending them to the observer slot
Browse files Browse the repository at this point in the history
  • Loading branch information
logaretm committed Feb 15, 2020
1 parent 121bffc commit 19f7886
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/core/src/components/Observer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { SetupContext, computed, provide } from 'vue';
import { normalizeChildren } from '../utils/vnode';
import { useForm } from '../useForm';
import { ValidationFlags } from '../types';

export const ValidationObserver = {
name: 'ValidationObserver',
Expand All @@ -10,7 +11,11 @@ export const ValidationObserver = {

const slotProps = computed(() => {
return {
...flags,
...Object.keys(flags).reduce((acc: ValidationFlags, key) => {
acc[key] = (flags as any)[key].value;

return acc;
}, {} as ValidationFlags),
errors: errors.value,
validate,
handleSubmit,
Expand Down

0 comments on commit 19f7886

Please sign in to comment.