mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-02 19:24:04 +00:00
36 lines
678 B
JavaScript
36 lines
678 B
JavaScript
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;
|
|
},
|
|
},
|
|
|
|
};
|