Skip to content

Commit 0da16ad

Browse files
authored
fix: avoid VueI18n extending on root (#1241)
1 parent b2e82ea commit 0da16ad

File tree

1 file changed

+6
-2
lines changed
  • packages/vue-i18n-core/src/mixins

1 file changed

+6
-2
lines changed

packages/vue-i18n-core/src/mixins/next.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,13 @@ export function defineMixin(
9999
this.$i18n.tm(key)
100100

101101
// extend vue-i18n legacy APIs
102-
if (i18n.__vueI18nExtend && !this.$i18n.__extened__) {
102+
if (
103+
this !== this.$root &&
104+
!this.$i18n.__extended__ &&
105+
i18n.__vueI18nExtend
106+
) {
103107
i18n.__vueI18nExtend(this.$i18n)
104-
this.$i18n.__extened__ = true
108+
this.$i18n.__extended__ = true
105109
}
106110
},
107111

0 commit comments

Comments
 (0)