Files
tout-doux/resources/ts/components/LangInput.vue
T
klemek c7b1f3ed49
TS Lint / Oxlint (push) Successful in 43s
TS Lint / TypeScript (push) Successful in 49s
TS Lint / ESLint (push) Successful in 1m10s
feat: lang
2026-07-14 10:45:35 +02:00

16 lines
382 B
Vue

<script setup lang="ts">
import { setCookie } from '@/lib/cookies';
import { useI18n } from 'vue-i18n';
const i18n = useI18n();
function onSetLang(lang: string) {
i18n.locale.value = lang;
setCookie('lang', lang);
}
</script>
<template>
<a href="#" @click.prevent="onSetLang('fr')">🇫🇷</a> / <a href="#" @click.prevent="onSetLang('en')">🇺🇸</a>
</template>