Created
February 1, 2019 07:29
-
-
Save ansidev/21643f57b5d9502517a076f6ccc89706 to your computer and use it in GitHub Desktop.
Handle resize event in Nuxt JS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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
Vue 3