mirror of
https://github.com/yawaflua/LuckyDiamond.git
synced 2025-12-10 04:09:29 +02:00
added mixin for mobile check
This commit is contained in:
13
luckydiamond/src/mixins/mixin.js
Normal file
13
luckydiamond/src/mixins/mixin.js
Normal 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user