refactor: migrate to nuxt compatibilityVersion: 4 (#3298)
This commit is contained in:
parent
46e4433e1c
commit
a3fbc056a9
342 changed files with 1200 additions and 2932 deletions
|
@ -1,23 +0,0 @@
|
|||
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) : ''
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue