David-Desmaisons / Vue.resize

Vue directive to detect resize events with deboucing and throttling capacity.
MIT License
327 stars 36 forks source link

Failed when activated for the second time in the keep-alive component #10

Closed zsedcbm closed 5 years ago

zsedcbm commented 5 years ago

When I wrap the div with the keep-alive component, v-resize is valid the first time it is entered. When the div re-triggers activated, v-resize is invalid.

zsedcbm commented 5 years ago

https://codepen.io/zsedcbm/pen/KJaNRO resize

zsedcbm commented 5 years ago

https://codepen.io/zsedcbm/pen/RvKKLd

no nested router looks like success

David-Desmaisons commented 5 years ago

I found this workaround:

  activated(){
    Vueresize.inserted(this.$el, { value: this.relayout});
  },
  deactivated(){
    Vueresize.unbind(this.$el, { value: this.relayout});
  },

Not the most elegant solution, but for now no better idea

https://codepen.io/dede89/pen/JzvPZZ

David-Desmaisons commented 5 years ago

Corrected in version 1.2.0