Skip to content

Instantly share code, notes, and snippets.

@Korveld
Forked from ansidev/resize-event.vue
Created July 19, 2022 18:57
Show Gist options
  • Save Korveld/8e998b227e03cf74d177f53bb82928a0 to your computer and use it in GitHub Desktop.
Save Korveld/8e998b227e03cf74d177f53bb82928a0 to your computer and use it in GitHub Desktop.
Handle resize event in Nuxt JS
<script>
export default {
mounted: function () {
this.$nextTick(function () {
this.onResize();
})
window.addEventListener('resize', this.onResize)
},
methods: {
onResize() {
console.log('Resized')
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment