You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My goal is to get this code to work, preferably using the global methods with the options API.
I've tried adding the global type declaration:
// vue-i18n.d.tsimport{DefineLocaleMessage,DefineDateTimeFormat,DefineNumberFormat}from'vue-i18n'importenfrom"@/locales/en";declare module 'vue-i18n'{// define the locale messages schemaexportinterfaceDefineLocaleMessageextends(typeofen){}// define the datetime format schemaexportinterfaceDefineDateTimeFormat{}// define the number format schemaexportinterfaceDefineNumberFormat{}}
I've also tried using the composition style useI18n<{message: typeof en}>. But I keep getting: 'key does not exist on type 'never' (when using global $tm) and 'number' when using useI18n.
Any help is much appreciated!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have some code that looks like this
My goal is to get this code to work, preferably using the global methods with the options API.
I've tried adding the global type declaration:
I've also tried using the composition style
useI18n<{message: typeof en}>
. But I keep getting: 'key does not exist on type 'never' (when using global $tm) and 'number' when using useI18n.Any help is much appreciated!
Beta Was this translation helpful? Give feedback.
All reactions