-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(projects): add switch-lang, add look-forward
- Loading branch information
1 parent
282b602
commit 0c66695
Showing
24 changed files
with
173 additions
and
36 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
"EDITMSG", | ||
"espree", | ||
"execa", | ||
"heroicons", | ||
"hexcode", | ||
"iconify", | ||
"INDEXEDDB", | ||
|
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 |
---|---|---|
|
@@ -7,6 +7,6 @@ | |
"serve": "vitepress serve" | ||
}, | ||
"devDependencies": { | ||
"vitepress": "1.0.0-rc.21" | ||
"vitepress": "1.0.0-rc.22" | ||
} | ||
} |
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 |
---|---|---|
|
@@ -17,6 +17,6 @@ | |
"localforage": "1.10.0" | ||
}, | ||
"devDependencies": { | ||
"@types/crypto-js": "4.1.2" | ||
"@types/crypto-js": "4.1.3" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<script setup lang="ts"> | ||
import { $t } from '@/locales'; | ||
defineOptions({ | ||
name: 'LookForward' | ||
}); | ||
</script> | ||
|
||
<template> | ||
<div class="flex-vertical-center gap-24px min-h-520px wh-full overflow-hidden"> | ||
<div class="flex text-400px text-primary"> | ||
<SvgIcon local-icon="expectation" /> | ||
</div> | ||
<h3 class="text-28px font-500 text-primary">{{ $t('common.lookForward') }}</h3> | ||
</div> | ||
</template> | ||
|
||
<style scoped></style> |
54 changes: 54 additions & 0 deletions
54
src/layouts/modules/global-header/components/switch-lang.vue
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,54 @@ | ||
<script setup lang="ts"> | ||
import { ref } from 'vue'; | ||
import type { MenuInfo } from 'ant-design-vue/es/menu/src/interface'; | ||
import { setLocale } from '@/locales'; | ||
import { localStg } from '@/utils/storage'; | ||
defineOptions({ | ||
name: 'SwitchLang' | ||
}); | ||
const locale = ref<App.I18n.LangType>(localStg.get('lang') || 'zh-CN'); | ||
type LocaleOption = { | ||
label: string; | ||
key: App.I18n.LangType; | ||
}; | ||
const options: LocaleOption[] = [ | ||
{ | ||
label: '中文', | ||
key: 'zh-CN' | ||
}, | ||
{ | ||
label: 'English', | ||
key: 'en' | ||
} | ||
]; | ||
function handleSelect(e: MenuInfo) { | ||
const key = e.key as App.I18n.LangType; | ||
locale.value = key; | ||
setLocale(key); | ||
localStg.set('lang', key); | ||
} | ||
</script> | ||
|
||
<template> | ||
<ADropdown placement="bottom"> | ||
<AButton type="text" class="h-full"> | ||
<div class="flex-y-center"> | ||
<SvgIcon icon="heroicons:language" class="text-icon" /> | ||
</div> | ||
</AButton> | ||
<template #overlay> | ||
<AMenu :selected-keys="[locale]" @click="handleSelect"> | ||
<AMenuItem v-for="option in options" :key="option.key"> | ||
{{ option.label }} | ||
</AMenuItem> | ||
</AMenu> | ||
</template> | ||
</ADropdown> | ||
</template> | ||
|
||
<style scoped></style> |
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
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.