This commit is contained in:
Qiuxia Fan 2022-05-06 16:52:17 +08:00
parent f5ef34252f
commit ddcfb8d890
3 changed files with 9 additions and 6 deletions

View File

@ -33,11 +33,6 @@ if (!appStore.utc) {
ElMessage.error(res.errors); ElMessage.error(res.errors);
} }
} }
if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
appStore.setIsMobile(true);
} else {
appStore.setIsMobile(false);
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.app-main { .app-main {

View File

@ -109,14 +109,21 @@ import { ref } from "vue";
import { useRouter, RouteRecordRaw } from "vue-router"; import { useRouter, RouteRecordRaw } from "vue-router";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import Icon from "@/components/Icon.vue"; import Icon from "@/components/Icon.vue";
import { useAppStoreWithOut } from "@/store/modules/app";
const appStore = useAppStoreWithOut();
const { t } = useI18n(); const { t } = useI18n();
const name = ref<any>(String(useRouter().currentRoute.value.name)); const name = ref<any>(String(useRouter().currentRoute.value.name));
const theme = ["VirtualMachine", "Kubernetes"].includes(name.value || "") const theme = ["VirtualMachine", "Kubernetes"].includes(name.value || "")
? ref("light") ? ref("light")
: ref("black"); : ref("black");
const routes = ref<any>(useRouter().options.routes); const routes = ref<any>(useRouter().options.routes);
const isCollapse = ref(false); if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
appStore.setIsMobile(true);
} else {
appStore.setIsMobile(false);
}
const isCollapse = ref(appStore.isMobile ? true : false);
const controlMenu = () => { const controlMenu = () => {
isCollapse.value = !isCollapse.value; isCollapse.value = !isCollapse.value;
}; };

View File

@ -25,6 +25,7 @@ body {
text-rendering: optimizeLegibility; text-rendering: optimizeLegibility;
text-size-adjust: 100%; text-size-adjust: 100%;
min-width: 1024px; min-width: 1024px;
height: 100%;
} }
html, html,