Essentially, I am searching for a computed property that will evaluate to true
when the window.innerwidth
is 768px or less and to false
when it exceeds 768px.
This is what I have attempted:
computed: {
isMobile() {
if (window.innerWidth <= 768) {
return true
}
return false
}
}
However, this computes the property only once, so any changes in window size are not reflected. How can I address this issue?