1
0
mirror of https://github.com/elk-zone/elk synced 2024-12-24 03:28:00 +09:00
elk/components/settings/SettingsLanguage.vue

16 lines
485 B
Vue
Raw Normal View History

<script lang="ts" setup>
import type { ComputedRef } from 'vue'
import type { LocaleObject } from '#i18n'
const { locale, setLocale } = useI18n()
const { locales } = useI18n() as { locales: ComputedRef<LocaleObject[]> }
</script>
<template>
<select :value="locale" @input="e => setLocale((e.target as any).value)">
2022-12-28 12:50:29 +09:00
<option v-for="item in locales" :key="item.code" :value="item.code" :selected="locale === item.code">
{{ item.name }}
</option>
</select>
</template>