We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0eba0bb commit e44bb17Copy full SHA for e44bb17
packages/vue-i18n-core/src/utils.ts
@@ -215,6 +215,11 @@ export function createTextNode(key: string): any {
215
}
216
217
export function getCurrentInstance(): GenericComponentInstance | ComponentInternalInstance | null {
218
- // @ts-ignore -- NOTE(kazupon): for Vue 3.6
219
- return Vue.currentInstance || Vue.getCurrentInstance()
+ // NOTE(kazupon): avoid bundler warning
+ const key = 'currentInstance'
220
+ if (key in Vue) {
221
+ return (Vue as any)[key] as GenericComponentInstance | null
222
+ } else {
223
+ return Vue.getCurrentInstance()
224
+ }
225
0 commit comments