Form Integration Demo Automatic Data Binding (Preferred) Manual State Management Native Form Submission
v-model) using v-model:property directive (e.g. v-model:value or v-model:checked)value/checked properties and change/input/blur event
listenersv-modelmodelValue property, you need to explicitly
specify which property should be bound to the model by using an argument — for example, v-model:value or
v-model:checked.<PInputText v-model:value="myInputText" :name="'myInputText'" :label="'Some Label'" />
...
const myInputText = ref('');
value or checked props along with input, change, and blur events. This approach allows flexible
integration with any form library.<PInputText :name="'myInputText'" :label="'Some Label'" :value="value" @input="onInput" />
...
const value = ref<string>('');
const onInput = (e: CustomEvent<InputTextInputEventDetail>) => {
value.value = (e.target as HTMLInputElement).value;
};
<form @submit.prevent="onSubmit">
<PInputText :name="'myInputText'" :label="'Some Label'" />
<PButton type="submit">Submit</PButton>
</form>
...
const onSubmit = (e: Event) => {
console.log(e);
};
