Currently, I am utilizing Vue JS within the Vuetify framework to build a dynamic form:
<v-text-field
v-for="items in itemsArray"
:key="items.id"
v-model="items.data"
:label="items.name"
></v-text-field>
This is an example structure of my itemsArray:
data: () => ({
itemsArray: [
{id: 6, name: 'Name'},
{id: 1, name: 'Email'},
{id: 17, name: 'Age'},
{id: 3, name: 'Height'},
{id: 4, name: 'Contact Number'},
],
}),
I am seeking guidance on how to implement validation for specific items within this array. For instance, I need to enforce a character limit of 8 and restrict input to only numbers for the item with id: 4 and name 'Contact Number'.
Although I have reviewed the Vuetify documentation, it does not provide clear instructions on how to validate items rendered dynamically through a loop.