francoislevesque / vue-braintree

Vue Component for Braintree Drop In
MIT License
23 stars 14 forks source link

How to call dropin teardown()? #42

Closed cchacholiades closed 2 years ago

cchacholiades commented 2 years ago

I am trying to destroy the dropin instance.

https://github.com/braintree/braintree-web-drop-in/issues/96

It seems this can be done via the teardown method.

I am currently doing this by storing the instance on @success in data like so:

data() {
    return {
        braintreeDropinInstance: null
    } 
} 

and then I have a method to call this.braintreeDropinInstance.teardown(). Should it be a method to call this with this package?

francoislevesque commented 2 years ago

Hi there!

I just updated the package (2.2.0), teardown() is now called with the beforeDestroy hook.

https://github.com/francoislevesque/vue-braintree/commit/93590bd0b18da2d5ce9ae36e35a872649b01a7cf#diff-1a6d27e1b3ce4fdfc2dae5bde8aa02bda1abcaf622befd5ca7e76fbda3f58b52

Does it suit your need?

cchacholiades commented 2 years ago

Hi, that's great - thank you 🎉