VfRow
Basic
VfRow defines a row inside a VfGrid. Each row contains one or more VfCol cells.
vue
<VfGrid name="contacts">
<VfRow>
<VfCol>
<VfText name="first_name" placeholder="First name" />
</VfCol>
<VfCol>
<VfText name="last_name" placeholder="Last name" />
</VfCol>
</VfRow>
<VfRow>
<VfCol>
<VfText name="email" placeholder="Email" />
</VfCol>
<VfCol>
<VfText name="phone" placeholder="Phone" />
</VfCol>
</VfRow>
</VfGrid>vue
<template>
<VfGrid name="contacts">
<VfRow>
<VfCol>
<VfText name="first_name" placeholder="First name" />
</VfCol>
<VfCol>
<VfText name="last_name" placeholder="Last name" />
</VfCol>
</VfRow>
<VfRow>
<VfCol>
<VfText name="email" placeholder="Email" />
</VfCol>
<VfCol>
<VfText name="phone" placeholder="Phone" />
</VfCol>
</VfRow>
</VfGrid>
</template>vue
<script setup lang="ts">
import { defineSchema, useForm } from '@vueform/ui'
const schema = defineSchema({
contacts: {
type: 'grid',
grid: [
[
{ type: 'text', name: 'first_name', placeholder: 'First name' },
{ type: 'text', name: 'last_name', placeholder: 'Last name' },
],
[
{ type: 'text', name: 'email', placeholder: 'Email' },
{ type: 'text', name: 'phone', placeholder: 'Phone' },
],
],
},
})
const [Form] = useForm({ schema })
</script>
<template>
<Form />
</template>Props
Configure the component's behavior and appearance with these props.
Layout
| Prop | Default | Description |
|---|---|---|
align | 'left' | The horizontal alignment of content within the row. |
valign | 'baseline' | The vertical alignment of content within the row. |
colspan | — | The number of grid columns this row spans. |
rowspan | — | The number of grid rows this row spans. |
Customization
| Prop | Default | Description |
|---|---|---|
parts | — | Custom DOM attribute overrides for the component's structural parts. |
class | — | CSS classes to apply to the component's root element. |
classes | — | Custom CSS class overrides for the component's structural parts. |
reclass | — | CSS class overrides that replace (rather than merge with) default classes. |
slots | — | Custom Vue components to use for named slots. Every component resolves it through the standard outlets pipeline (see useOutlets). |
presets | — | Named configuration presets to apply to the component. |
template | — | A custom Vue component to use as the template instead of the default. |
component | — | A custom Vue component to render in the component's default slot. |
Context
Reactive properties and methods accessible on the component's Context object.
General
| Name | Description |
|---|---|
props | The resolved component props with defaults applied. |
Row
| Name | Description |
|---|---|
row | The zero-based row index within the parent grid. |
cols | The UIDs of the columns belonging to this row. |
Layout
| Name | Description |
|---|---|
classes | The resolved CSS class map for the component. |
parts | The resolved DOM attribute overrides for internal elements. |
Events
| Name | Description |
|---|---|
fire() | Fires an event synchronously, invoking before, main, and after listeners in order. |
fireAsync() | Fires an event asynchronously, awaiting each callback and short-circuiting when any returns false. |
on() | Subscribes a callback to a specific event. |
off() | Removes a previously registered event callback. |
onBefore() | Registers a callback that runs before the main event listeners. |
onAfter() | Registers a callback that runs after the main event listeners. |
Accessibility
| Name | Description |
|---|---|
uid | The unique internal identifier for this row instance. |
Events
Events emitted by the component. See Events for details.
| Name | Params | Description |
|---|---|---|
beforeMount | context$ | Emitted before the component is mounted. |
mounted | context$ | Emitted after the component is mounted. |
beforeUnmount | context$ | Emitted before the component is unmounted. |
unmounted | context$ | Emitted after the component is unmounted. |
updated | context$ | Emitted after the component is updated. |
Slots
Named Slots for replacing parts of the component's rendering.
| Name | Scope | Description |
|---|---|---|
template | context | Slot that replaces the entire component rendering. Receives the full component context as a single context prop. |
default | — | Slot for the row's default content. |
Parts
DOM attribute overrides targeting internal elements. See Parts for details.
root
The root row element.
| Element | <div> |
| Classes | .vf-grid-row |