File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,11 @@ const setLocale: typeof setNuxti18nLocale = newLocale => {
4040 settings .value .selectedLocale = newLocale
4141 return setNuxti18nLocale (newLocale )
4242}
43+
44+ function handleLocaleChange(newLocale ? : string ) {
45+ if (! newLocale ) return
46+ setLocale (newLocale )
47+ }
4348 </script >
4449
4550<template >
@@ -244,8 +249,8 @@ const setLocale: typeof setNuxti18nLocale = newLocale => {
244249 <SelectField
245250 id =" language-select"
246251 :items =" locales.map(loc => ({ label: loc.name ?? '', value: loc.code }))"
247- v-model =" currentLocale"
248- @update:modelValue =" setLocale($event as typeof currentLocale) "
252+ :modelValue =" currentLocale"
253+ @update:modelValue =" handleLocaleChange "
249254 block
250255 size =" sm"
251256 class =" max-w-48"
You can’t perform that action at this time.
0 commit comments