Answer the question
In order to leave comments, you need to log in
How to pass input value to vue.js props?
When you enter data into the form, an error immediately flies in the console
Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "name"
<form @submit.prevent="toSend">
<input placeholder="Ваше имя" type="text" name="name" id="name" required="" v-model.trim="name">
<input placeholder="Ваш телефон" type="text" name="phone" id="phone" required="" v-model.number="phone">
<input placeholder="Ваш e-mail" type="email" name="email" id="email" required=""
v-model.trim="email">
<input type="submit" value="отправить заявку">
</form>
--------------------------------
export default {
props: ['task', 'titleMail', 'name', 'phone', 'email', 'titleForm'],
...
<contactForm task="order" titleMail="test" titleForm="test"/>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question