mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 16:28:31 +00:00
Update the nuxt3 version. Co-authored-by: Jonathan Adeline <jonathan@baserow.io> Co-authored-by: Bram Wiepjes <bramw@protonmail.com> Co-authored-by: Cezary <cezary@baserow.io> Co-authored-by: Tsering Paljor <tsering@baserow.io> Co-authored-by: Przemyslaw Kukulski <przemyslaw+gh@baserow.io> Co-authored-by: Bram <bram2w@users.noreply.github.com>
41 lines
696 B
Vue
41 lines
696 B
Vue
<template>
|
|
<Dropdown
|
|
ref="dropdown"
|
|
v-model="language"
|
|
class="dropdown--floating-left"
|
|
:show-search="false"
|
|
v-bind="$attrs"
|
|
>
|
|
<DropdownItem
|
|
v-for="loc in locales"
|
|
:key="loc.code"
|
|
:name="loc.name"
|
|
:value="loc.code"
|
|
/>
|
|
</Dropdown>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { ref, computed } from 'vue'
|
|
import { useI18n } from 'vue-i18n'
|
|
|
|
const dropdown = ref(null)
|
|
|
|
const { locale, locales, setLocale } = useI18n()
|
|
|
|
const language = computed({
|
|
get: () => locale.value,
|
|
set: async (value) => {
|
|
await setLocale(value)
|
|
},
|
|
})
|
|
|
|
const toggle = (...args) => {
|
|
return dropdown.value?.toggle?.(...args)
|
|
}
|
|
|
|
defineExpose({
|
|
toggle,
|
|
})
|
|
</script>
|