[Vuejs]-Vue $emit event triggering but this.$root.$on does nothing

0👍

This worked:

<template>
    <div>
        <PayPal
            :client="paypal"
            :amount="cartTotalPrice"
            :currency="customer.currency"
            :env="paypalEnvironment"
            :button-style="paypalStyle"
            @payment-authorized="paymentAuthorized" // ADD THIS
        />
    </div>
</template>

methods: {
    paymentAuthorized() {
        alert('authorized'); // HANDLE EVENT HERE
    },
},

Leave a comment