set this.windowWidth, and change computed showMobileMenu

This commit is contained in:
ogerly 2022-10-21 12:50:13 +02:00
parent b467e6846a
commit bdf848b237

View File

@ -259,6 +259,7 @@ export default {
return firstRoute && firstRoute.name === 'index' return firstRoute && firstRoute.name === 'index'
}, },
showMobileMenu() { showMobileMenu() {
if (!this.windowWidth) return false
return this.windowWidth < 810 return this.windowWidth < 810
}, },
}, },
@ -268,6 +269,7 @@ export default {
}, },
}, },
mounted() { mounted() {
this.windowWidth = window.innerWidth
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.windowWidth = window.innerWidth this.windowWidth = window.innerWidth
}) })