5👍
✅
Your main issue lies with this line:
sendEmail: (e) => {
VueJS documentation explicit states that you should not use arrow functions when declaring methods, because the this
inside the methods will not refer to the VueJS component itself.
Note that you should not use an arrow function to define a method (e.g.
plus: () => this.a++
). The reason is arrow functions bind the parent context, sothis
will not be the Vue instance as you expect andthis.a
will be undefined.
Therefore, this will fix your issue:
sendEmail: function(e) {
or:
sendEmail(e) {
Source:stackexchange.com