0
As there is no line mentioned for this error, I’m assuming the error is coming from type checking on the function. Your TSConfig is set to not allow implicit any but you haven’t declared the type parameter of locale.
This should be changed to:
changeLocale(locale: string){
this.$root.$i18n.locale = locale;
}
It’s also worth mentioning you’ve declared pure setup composition API so you don’t need to do export default {…}.
This could be written as:
<script setup lang="ts">
const changeLocale = (locale: string) => {
this.$root.$i18n.locale = locale;
}
</script>
Source:stackexchange.com