Answer the question
In order to leave comments, you need to log in
How to pass a parameter to a function of another Vue component?
You need to pass the email data to the child component of
the main component:
<template>
<checkPhone
v-show="isModalVisible"
@close="closeModal"/>
</template
<script>
import checkPhone from "~/components/auth/checkPhone.vue"
data() {
return { email:""}
}
methods: {
components: { checkPhone }
signin() {
axios.post('auth/signin', {
user: {
email: this.email,
password: this.password,
}
}
</script>
<script>
checkEmail() {
axios.post('auth/signin/confirm', {
user: {
email:this.email,
confirmation_code: this.confirmation_code
}
}
}
</script>
Answer the question
In order to leave comments, you need to log in
In parent:
<template>
<checkPhone
v-show="isModalVisible"
@close="closeModal"
:email="email"
/>
</template>
<script>
checkEmail() {
axios.post('auth/signin/confirm', {
user: {
email:this.email,
confirmation_code: this.confirmation_code
}
}
}
export default {
props:{
email:{
type: String,
}
}
}
</script>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question