So I am trying to write a form component that I can render and use different v-models to make a request.
Component:
<v-form>
<v-container>
<v-row>
<v-col
cols="12"
md="4"
>
<v-text-field
label="First name"
required
autocomplete="off"
clearable
:disabled="disable"
v-model="modalFirstNameValue"
:label="modalFirstNameLabel"
></v-text-field>
</v-col>
<v-col
cols="12"
md="4"
>
<v-text-field
label="Last name"
required
autocomplete="off"
clearable
:disabled="disable"
v-model="modalLastNameValue"
:label="modalLastNameLabel"
></v-text-field>
</v-col>
</v-container>
</v-form>
<script>
export default {
props: ['modalFirstNameValue','modalFirstNameLabel'
],
name: 'modal',
</script>
Component Imported:
<template>
<div id="app">
<FormModal
v-bind:modalFirstNameValue="modalFirstNameValue"
v-bind:modalFirstNameLabel="modalFirstNameLabel"
/>
</div>
</template>
Unfortunately, I keep getting this error.
Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders
What I would like to do is to be able to catch the input values on the other side so that I can then use them to make GET or Post requests via the form.