elk/components/settings/SettingsLanguage.vue
2023-01-16 00:15:40 +01:00

19 lines
501 B
Vue

<script lang="ts" setup>
import type { ComputedRef } from 'vue'
import type { LocaleObject } from '#i18n'
const props = defineProps<{
language?: string
}>()
const model = useVModel(props, 'language')
const { locales } = useI18n() as { locales: ComputedRef<LocaleObject[]> }
</script>
<template>
<select v-model="model">
<option v-for="item in locales" :key="item.code" :value="item.code" :selected="props.language === item.code">
{{ item.name }}
</option>
</select>
</template>