feat: bump to latest vue 3.4.19 (#2607)

Co-authored-by: patak <matias.capeletto@gmail.com>
This commit is contained in:
Joaquín Sánchez 2024-02-24 13:24:21 +01:00 committed by GitHub
parent 81ef8ff9aa
commit 36004a7eba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
40 changed files with 601 additions and 451 deletions

23
utils/i18n.ts Normal file
View file

@ -0,0 +1,23 @@
import { useI18n as useOriginalI18n } from 'vue-i18n'
export function useI18n() {
const {
t,
d,
n,
...rest
} = useOriginalI18n()
return {
...rest,
t: wrapI18n(t),
d: wrapI18n(d),
n: wrapI18n(n),
} satisfies ReturnType<typeof useOriginalI18n>
}
export function wrapI18n<T extends (...args: any[]) => any>(t: T): T {
return <T>((...args: any[]) => {
return isHydrated.value ? t(...args) : ''
})
}