optimize for mobile

This commit is contained in:
LouisLam
2021-07-11 15:23:28 +08:00
parent ae07cd9c35
commit f9800a087e
5 changed files with 109 additions and 22 deletions

View File

@@ -25,10 +25,14 @@ export default {
avgPingList: { },
uptimeList: { },
notificationList: [],
windowWidth: window.innerWidth,
showListMobile: false,
}
},
created() {
window.addEventListener('resize', this.onResize);
let wsHost;
if (localStorage.dev === "dev") {
wsHost = ":3001"
@@ -136,6 +140,14 @@ export default {
methods: {
cancelActiveList() {
this.$root.showListMobile = false;
},
onResize() {
this.windowWidth = window.innerWidth;
},
storage() {
return (this.remember) ? localStorage : sessionStorage;
},
@@ -209,6 +221,10 @@ export default {
computed: {
isMobile() {
return this.windowWidth <= 767.98;
},
timezone() {
if (this.userTimezone === "auto") {