$emit event is not firing from inside component. Not sure If I am using $emit correctly but I am assuming I am not because it is not firing. I have a method coming from a mixin file so not sure if that could be causing issue as well.
UPDATE: The emit is firing but it only fires on a page load /hard refresh and then click the trigger
component:
<template>
<router-link v-if="useRouterLink" @click.native="$emit('cta-click', $event)"
:to="buttonHref" class="cta__button button" v-html="buttonText"> </router-link>
</template>
parent:
<CTA @cta-click="gtmCtaClick('Sign Up', 'click')"></CTA>
mixin file:
gtmCtaClick(linkText, action) {
this.$gtm.push({
event: 'cta_click',
link_text: linkText,
action: action
})
}