Skip to content

Commit

Permalink
🪅feat:mobile适配
Browse files Browse the repository at this point in the history
  • Loading branch information
durunsong committed Oct 10, 2024
1 parent 1376671 commit c5af4c5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 7 additions & 2 deletions src/components/LanguageSwitcher/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<template #reference>
<div class="reference_btn">
<SvgIcon name="select_lang" :aria-hidden="false"></SvgIcon>
<span v-show="isMobileWidth">{{ current_language }}</span>
<span class="current_language">{{ current_language }}</span>
</div>
</template>
<div class="category_btn_cate">
Expand Down Expand Up @@ -51,7 +51,6 @@ import { useI18n } from "vue-i18n";
import CACHE_KEY from "@/constants/cache-key";
import { getLocalData, setLocalData } from "@/utils/cache/local-storage";
const isMobileWidth = ref(window.innerWidth <= 880 ? false : true);
const { t, locale } = useI18n();
const router = useRouter();
const popoverVisible = ref(false);
Expand Down Expand Up @@ -275,4 +274,10 @@ const confirmLang = () => {
}
}
}
/** 移动端适配 */
@media screen and (max-width: 880px) {
.current_language {
display: none;
}
}
</style>
3 changes: 1 addition & 2 deletions src/views/login/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,7 @@ const registerRules: FormRules = {
};
// 演示账号切换
const changeRole = (role: string) => {
console.log(role);
const changeRole = (role: string | number | boolean | undefined) => {
if (role === "admin") {
Object.assign(form, {
userName: "admin",
Expand Down

0 comments on commit c5af4c5

Please sign in to comment.