vue get window width
data() {
return {
windowWidth: window.innerHeight,
success: false
}
},
mounted() {
window.onresize = () => {
this.windowWidth = window.innerWidth
}
},
vue get window width
data() {
return {
windowWidth: window.innerHeight,
success: false
}
},
mounted() {
window.onresize = () => {
this.windowWidth = window.innerWidth
}
},
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...
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us