0👍
✅
This solution worked after I rebuilt the app
declare module '@vue/runtime-core' {
interface ComponentCustomProperties {
$t(key: string): string
}
}
0👍
You need to reference the ‘$t’ variable also in your main.ts. This is the only solution I’ve found. You can also try to define your property like so:
Object.defineProperty(app.config.globalProperties, '$t', {
/* your definitions here */
})
Source:stackexchange.com