mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-22 14:42:51 +08:00
[status page] improve mobile layout
This commit is contained in:
@@ -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;
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user