> For the complete documentation index, see [llms.txt](https://vue-generators.gitbook.io/vue-generators/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vue-generators.gitbook.io/vue-generators/develop/component/events.md).

# Events

Events emitted by the [VFG Component](/vue-generators/develop/component.md)

## validated

This event is triggered whenever the form has completed validating. It provides the `boolean` result of this validation, any errors that may have occurred and a reference to the VFG component which triggered the validation.

Internally, the event is triggered with

```javascript
this.$emit("validated", isValid, this.errors, this);
```

`isValid` will contain a `boolean` value indicating whether the form is valid, `true` indicates the the validation succeeded. `false` indicates that it failed, and the errors array will contain any error messages from the validation rules.

You can listen for this by attaching to the `@validated` (`v-validated`) event on the `<vue-form-generator />` component.

## model-updated

This event is triggered whenever the the model attached to the form has been updated, usually due to user interaction. It provides the new value and a reference to the property name for the field which was just updated. This event is triggered each time a field is updated.

Internally, the event is triggered with

```javascript
this.$emit("model-updated", newVal, schema);
```

`newVal` is the value that was just updated, and `schema` is a reference to the model's property name found in the [field schema](/vue-generators/develop/component/schema.md). `schema` will only contain the individual property name, and not the full schema. This allows you to identify which field was just updated.

You can listen for this by attaching to the `@model-updated` (`v-model-updated`) event on the `<vue-form-generator />` component.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://vue-generators.gitbook.io/vue-generators/develop/component/events.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
