added mixin for mobile check

This commit is contained in:
Kostya
2023-12-16 15:15:24 +03:00
parent 4960d1dbd6
commit f763c1f301
6 changed files with 42 additions and 17 deletions

View File

@@ -0,0 +1,13 @@
export const Mixins = {
methods: {
checkWindowSize() {
this.mobile = window.innerWidth <= 600
},
AddWindowListener() {
window.addEventListener('resize', this.checkWindowSize)
},
RemoveWindowListener() {
window.removeEventListener('resize', this.checkWindowSize)
}
}
}