0👍
handleSubmit
does not pass the event argument to the given callback, so e
is undefined.
Instead of e.target
(which would be the form element if the event were passed), you could reference the form directly with a template ref:
<form ref="myForm">
export default {
methods: {
sendEmail() {
try {
emailjs.sendForm(
'service_xxx',
'template_xxx',
this.$refs.myForm, 👈
'user_xxx',
{
name: this.name,
email: this.email,
message: this.message,
}
)
} catch (error) {
console.log({ error })
}
}
}
}
- [Vuejs]-Is there an a way to print value of input In certain places of the a4 paper via html javascript?
- [Vuejs]-AddEventListener to element clientWidth vue 3
Source:stackexchange.com