2022-12-27 23:03:50 +00:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import type { ComputedRef } from 'vue'
|
|
|
|
import type { LocaleObject } from '#i18n'
|
|
|
|
|
2023-01-12 17:52:52 +00:00
|
|
|
const userSettings = useUserSettings()
|
|
|
|
|
2022-12-27 23:03:50 +00:00
|
|
|
const { locales } = useI18n() as { locales: ComputedRef<LocaleObject[]> }
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2023-01-12 17:52:52 +00:00
|
|
|
<select v-model="userSettings.language">
|
|
|
|
<option v-for="item in locales" :key="item.code" :value="item.code" :selected="userSettings.language === item.code">
|
2022-12-27 23:03:50 +00:00
|
|
|
{{ item.name }}
|
|
|
|
</option>
|
|
|
|
</select>
|
|
|
|
</template>
|