LouisLam
3 years ago
4 changed files with 47 additions and 13 deletions
@ -0,0 +1,25 @@ |
|||
export default { |
|||
|
|||
data() { |
|||
return { |
|||
windowWidth: window.innerWidth, |
|||
} |
|||
}, |
|||
|
|||
created() { |
|||
window.addEventListener("resize", this.onResize); |
|||
}, |
|||
|
|||
methods: { |
|||
onResize() { |
|||
this.windowWidth = window.innerWidth; |
|||
}, |
|||
}, |
|||
|
|||
computed: { |
|||
isMobile() { |
|||
return this.windowWidth <= 767.98; |
|||
}, |
|||
} |
|||
|
|||
} |
Loading…
Reference in new issue