Skip to content

Commit

Permalink
Merge pull request eee555#58 from putianyi889/patch-43
Browse files Browse the repository at this point in the history
LanguagePicker兼容深色模式
  • Loading branch information
eee555 authored Jul 9, 2024
2 parents 20b8a9c + 3d19dc0 commit ce89a08
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
3 changes: 0 additions & 3 deletions front_end/src/assets/language.svg

This file was deleted.

19 changes: 12 additions & 7 deletions front_end/src/components/LanguagePicker.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<template>
<el-dropdown @command="changeLanguage" trigger="click">
<el-image :src="logo_lang" class="icon"></el-image>
<el-icon class="icon" size="30px">
<svg width="800px" height="800px" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<title>ionicons-v5-l</title>
<path
d="M478.33,433.6l-90-218a22,22,0,0,0-40.67,0l-90,218a22,22,0,1,0,40.67,16.79L316.66,406H419.33l18.33,44.39A22,22,0,0,0,458,464a22,22,0,0,0,20.32-30.4ZM334.83,362,368,281.65,401.17,362Z" />
<path
d="M267.84,342.92a22,22,0,0,0-4.89-30.7c-.2-.15-15-11.13-36.49-34.73,39.65-53.68,62.11-114.75,71.27-143.49H330a22,22,0,0,0,0-44H214V70a22,22,0,0,0-44,0V90H54a22,22,0,0,0,0,44H251.25c-9.52,26.95-27.05,69.5-53.79,108.36-31.41-41.68-43.08-68.65-43.17-68.87a22,22,0,0,0-40.58,17c.58,1.38,14.55,34.23,52.86,83.93.92,1.19,1.83,2.35,2.74,3.51-39.24,44.35-77.74,71.86-93.85,80.74a22,22,0,1,0,21.07,38.63c2.16-1.18,48.6-26.89,101.63-85.59,22.52,24.08,38,35.44,38.93,36.1a22,22,0,0,0,30.75-4.9Z" />
</svg><!-- Source: https://www.svgrepo.com/svg/326688/language-outline -->
</el-icon>
<template #dropdown>
<el-dropdown-item v-for="item in options" :command="item.lang">
{{ item.text }}
Expand All @@ -18,13 +26,11 @@ const t = useI18n();
import { useLocalStore } from "@/store";
const local = useLocalStore();
import logo_lang from "@/assets/language.svg";
const options = [
{ lang: "zh-cn", text: "简体中文" },
{ lang: "en", text: "English" },
{ lang: "de", text: "name" },
{ lang: "pl", text: "polski"},
{ lang: "pl", text: "polski" },
{ lang: "dev", text: "dev" },
];
Expand All @@ -40,9 +46,8 @@ const changeLanguage = (value: any) => {

<style lang="less" scoped>
.icon {
margin-top: v-bind("(local.menu_height - local.menu_font_size) / 2 + 'px'");
min-width: v-bind("local.menu_font_size + 'px'");
height: v-bind("local.menu_font_size + 'px'");
margin-top: v-bind("(local.menu_height) / 2 + 'px'");
height: 0px;
cursor: pointer;
}
</style>

0 comments on commit ce89a08

Please sign in to comment.