This repository has been archived by the owner on Nov 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Complete the function optimization of v1.0.1 version
- Loading branch information
Showing
31 changed files
with
267 additions
and
46 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
<template> | ||
<div class="flex flex-col"> | ||
<theme-com /> | ||
<video-show /> | ||
<language /> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import ThemeCom from './theme.vue' | ||
import VideoShow from './videoShow.vue' | ||
import Language from './language.vue' | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<template> | ||
<div class="p-4 flex flex-row items-center"> | ||
<div class="w-40 font-bold">{{ t('config.language.label') }}:</div> | ||
<el-radio-group v-model="radio" @change="handleChange"> | ||
<el-radio :label="1" class="w-20">{{ t('config.language.zh') }}</el-radio> | ||
<el-radio :label="2" class="w-20">{{ t('config.language.en') }}</el-radio> | ||
<el-radio :label="3" class="w-20">{{ t('config.language.auto') }}</el-radio> | ||
</el-radio-group> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { onMounted, ref } from 'vue' | ||
import { useI18n } from 'vue-i18n' | ||
import { useStore } from 'vuex' | ||
const { t, locale } = useI18n() | ||
const store = useStore() | ||
const radio = ref(3) | ||
const switchLanguageToZH = () => { | ||
locale.value = 'zh_CN' | ||
} | ||
const switchLanguageToEN = () => { | ||
locale.value = 'en_GB' | ||
} | ||
const switchLanguageToAuto = () => { | ||
switch (navigator.language) { | ||
// 环境语言中间的线是居中的 | ||
case 'zh-CN': | ||
switchLanguageToZH() | ||
break | ||
case 'en-GB': | ||
switchLanguageToEN() | ||
break | ||
default: | ||
switchLanguageToEN() | ||
} | ||
} | ||
const handleLanguageSwitch = (label: number) => { | ||
switch (label) { | ||
case 1: | ||
switchLanguageToZH() | ||
break | ||
case 2: | ||
switchLanguageToEN() | ||
break | ||
case 3: | ||
switchLanguageToAuto() | ||
break | ||
default: | ||
switchLanguageToAuto() | ||
} | ||
} | ||
const handleChange = async (label: number) => { | ||
handleLanguageSwitch(label) | ||
await store.dispatch('config/updateLanguage', label) | ||
} | ||
onMounted(() => { | ||
radio.value = store.getters.language || 3 | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.