[status page] improve mobile layout

This commit is contained in:
LouisLam
2021-09-23 16:31:45 +08:00
parent 439f45d91e
commit 27d4c3c194
5 changed files with 32 additions and 20 deletions

View File

@@ -3,23 +3,34 @@ export default {
data() {
return {
windowWidth: window.innerWidth,
}
};
},
created() {
window.addEventListener("resize", this.onResize);
this.updateBody();
},
methods: {
onResize() {
this.windowWidth = window.innerWidth;
this.updateBody();
},
updateBody() {
if (this.isMobile) {
document.body.classList.add("mobile");
} else {
document.body.classList.remove("mobile");
}
}
},
computed: {
isMobile() {
return this.windowWidth <= 767.98;
},
}
},
}
};