Open huang-julien opened 1 year ago
This issue is related to vue-i18n v9. vue-i18n v9 has a Legacy API (options API) style and a composition API style. vue-i18n should support the type inference for both API styles. ref: https://github.com/intlify/vue-i18n-next/issues/1113#issuecomment-1210711003
BTW, nuxt i18n module allows you to change the type behavior of $i18n
with the types
option.
https://v8.i18n.nuxtjs.org/options/misc#types
Environment
Build Modules: -
Reproduction
Describe the bug
when using
useNuxtApp().$i18n.locale
, the returned type isstring & WritableComputedRef<string>
which can be very confusing for developers and even linters as it does not warns that it is an object when migrating from i18n vue 2, Nuxt 2 or bridge.Additional context
No response
Logs
No response