Skip to content

Commit

Permalink
chore: remove log
Browse files Browse the repository at this point in the history
  • Loading branch information
logaretm committed Nov 23, 2023
1 parent d031d87 commit 1a8a045
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions docs/src/pages/guide/composition-api/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ For example, if you have a field called `email` in the form context, the field p
```ts
const { defineField } = useForm();

const email = defineField('email');
const [email, emailAttrs] = defineField('email');
```

Note that `defineField` generates a pair of values, the first one is the value model and the second one is the attributes/props object. The props object contain attributes or event listeners that are useful to have on the input control or component which enables custom validation triggers and more.

Here is a basic example of how to use `defineField` with a simple input element:

<Repl files={{ 'App.vue': 'CompositionInputBindsBasic01' }} client:only />
Expand Down Expand Up @@ -139,8 +141,6 @@ Notice that for components, validations are executed immediately. This is intend

### Mapping attributes and props

You have noticed in the previous examples that `defineField` generates a pair of values, the first one is the value model and the second one is the bindings object. The bindings object contain attributes or event listeners that are useful to have on the input control or component.

But aside from the attributes and listeners that vee-validate adds to those binding objects, you can also map the attributes and props of the in. This is useful when you want to:

- When you want to map the attributes/props to a different name.
Expand Down
1 change: 0 additions & 1 deletion packages/vee-validate/src/useForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,6 @@ export function useForm<
config?: Partial<InputBindsConfig<TValue, TExtras>> | LazyInputBindsConfig<TValue, TExtras>,
) {
const label = isCallable(config) ? undefined : config?.label;
console.log(label);
const pathState = (findPathState(toValue(path)) || createPathState(path, { label })) as PathState<TValue>;
const evalConfig = () => (isCallable(config) ? config(omit(pathState, PRIVATE_PATH_STATE_KEYS)) : config || {});

Expand Down

0 comments on commit 1a8a045

Please sign in to comment.