index.vue 674 B

1234567891011121314151617181920212223242526272829
  1. <template>
  2. <n-dropdown
  3. trigger="hover"
  4. @select="handleSelect"
  5. :show-arrow="true"
  6. :options="options"
  7. >
  8. <n-button quaternary>
  9. <n-icon size="20" :depth="1">
  10. <LanguageIcon />
  11. </n-icon>
  12. </n-button>
  13. </n-dropdown>
  14. </template>
  15. <script lang="ts" setup>
  16. import { useLangStore } from '@/store/modules/langStore/langStore'
  17. import { langList } from '@/settings/designSetting'
  18. import { LangEnum } from '@/enums/styleEnum'
  19. import { icon } from '@/plugins'
  20. const { LanguageIcon } = icon.ionicons5
  21. const langStore = useLangStore()
  22. const options = langList
  23. const handleSelect = (key: LangEnum) => {
  24. langStore.changeLang(key)
  25. }
  26. </script>