Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

track window resize in vue

created() {
  window.addEventListener("resize", this.myEventHandler);
},
destroyed() {
  window.removeEventListener("resize", this.myEventHandler);
},
methods: {
  myEventHandler(e) {
    // your code for handling resize...
  }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #track #window #resize #vue
ADD COMMENT
Topic
Name
3+9 =