Components
NotForm
The main wrapper component that provides form context to its children.
NotForm is a wrapper component that manages the form lifecycle and provides the form context to nested components like NotField and NotMessage.
Usage
form.vue
<script setup lang="ts">
const { id, submit } = useNotForm({ schema })
</script>
<template>
<NotForm :id="id" @submit="submit">
<!-- Form fields go here -->
<button type="submit">Submit</button>
</NotForm>
</template>
API
Props
| Prop | Type | Default | Description |
|---|---|---|---|
id | string | Required | The unique form identifier obtained from useNotForm. |
as | string | 'form' | The HTML tag the component should render as. |
asChild | boolean | false | Whether to render the component as its nearest child (renderless). |
Slots
default
The default slot provides access to the entire form context.
Scope:
| Property | Type | Description |
|---|---|---|
state | Ref<Input> | Reactive form data. |
errors | Ref<Issue[]> | Reactive validation issues. |
isValid | ComputedRef<boolean> | Form validity status. |
isDirty | ComputedRef<boolean> | Form modification status. |
submit | Function | Form submission handler. |
reset | Function | Form reset handler. |
... | ... | All other properties returned by useNotForm. |