borisbutenko/bp-vuejs-dropdown

Event listeners never removed -> potential memory Leak

AndreaRavano opened this issue · 0 comments

Hi, i noticed that the event listeners are never removed. This can cause memory Leak when Switching Routes.

I think this can be easily solved with something like:

`
...

methods:{

  hide(){
    
    this.isHidden = true
  }

...
},

...
beforeDestroy(){

  $root.$off('bp-dropdown:open', this.hide);
  
  $root.$off('bp-dropdown:hide', this.hide);
}

`

Thanks for the handful component,

regards,

Andrea.