[Vuejs]-Why does vue emit not allow me to update parent data?

0👍

self.$emit('failed',false);

<SocialLogin @wait="waitOnSocial" @failed="(v)=>{socialFailed = v}" @toggleAuth="socialLoginInProgress" style="width: 100%" />

Refactor to direct emit payload.

0👍

try this.$emit

Because the this keyword has a different value in the function that is invoked by setInterval.

You already know the solution with the self variable in a closure, a different (and shorter) solution would be binding the emit method:

0👍

The only solution I could find was a little hacky and instead of emitting in the child component I access the parent variable directly:

this.$parent.showForm = true;

Leave a comment