elk/components/settings/SettingsLanguage.vue

16 lines
400 B
Vue
Raw Normal View History

<script lang="ts" setup>
2023-01-09 21:20:26 +01:00
import { locale, locales } from '~/config/i18n'
2023-01-09 21:20:26 +01:00
const setLocale = (code: string) => {
locale.value = code
}
</script>
<template>
<select :value="locale" @input="e => setLocale((e.target as any).value)">
2022-12-28 04:50:29 +01:00
<option v-for="item in locales" :key="item.code" :value="item.code" :selected="locale === item.code">
{{ item.name }}
</option>
</select>
</template>