-
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 LangSwitch to component, fix login page i18n
- Loading branch information
1 parent
50b722c
commit e435b18
Showing
19 changed files
with
169 additions
and
99 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,41 @@ | ||
<script setup lang="ts"> | ||
defineOptions({ | ||
name: 'LangSwitch' | ||
}); | ||
interface Props { | ||
lang: App.I18n.LangType; | ||
langOptions: App.I18n.LangOption[]; | ||
} | ||
defineProps<Props>(); | ||
type Emits = { | ||
(e: 'changeLang', lang: App.I18n.LangType): void; | ||
}; | ||
const emits = defineEmits<Emits>(); | ||
function changeLang(lang: App.I18n.LangType) { | ||
emits('changeLang', lang); | ||
} | ||
</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="[lang]"> | ||
<AMenuItem v-for="option in langOptions" :key="option.key" @click="changeLang(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
44 changes: 0 additions & 44 deletions
44
src/layouts/modules/global-header/components/switch-lang.vue
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<script setup lang="ts"> | ||
defineOptions({ | ||
name: 'ContextMenu' | ||
}); | ||
</script> | ||
|
||
<template> | ||
<div></div> | ||
</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
Oops, something went wrong.