105
rated 0 times
[
106]
[
1]
/ answers: 1 / hits: 16474
/ 6 Years ago, wed, may 23, 2018, 12:00:00
Basically, what I need is a computed property that returns true
when the window.innerwidth
is equal or lower than 768px and false
when it's higher than 768px.
What I did:
computed: {
isMobile() {
if (window.innerWidth <= 768) {
return true
}
return false
}
}
But that computes that property only once, and if I resize the window later, it doesn't react to that change. What can I do?
More From » vue.js