Skip to content

Commit e84af07

Browse files
authored
fix: conflict process global object in vDirective function (#1110)
related #1096 #1107
1 parent f30c8a4 commit e84af07

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/vue-i18n-core/src/directive.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function getComposer(
8888
export type TranslationDirective<T = HTMLElement> = ObjectDirective<T>
8989

9090
export function vTDirective(i18n: I18n): TranslationDirective<HTMLElement> {
91-
const process = (binding: DirectiveBinding): [string, Composer] => {
91+
const _process = (binding: DirectiveBinding): [string, Composer] => {
9292
const { instance, modifiers, value } = binding
9393
/* istanbul ignore if */
9494
if (!instance || !instance.$) {
@@ -108,7 +108,7 @@ export function vTDirective(i18n: I18n): TranslationDirective<HTMLElement> {
108108
}
109109

110110
const register = (el: HTMLElement, binding: DirectiveBinding): void => {
111-
const [textContent, composer] = process(binding)
111+
const [textContent, composer] = _process(binding)
112112
if (inBrowser && i18n.global === composer) {
113113
// global scope only
114114
el.__i18nWatcher = watch(composer.locale, () => {
@@ -141,7 +141,7 @@ export function vTDirective(i18n: I18n): TranslationDirective<HTMLElement> {
141141
}
142142
}
143143
const getSSRProps = (binding: DirectiveBinding) => {
144-
const [textContent] = process(binding)
144+
const [textContent] = _process(binding)
145145
return { textContent }
146146
}
147147

0 commit comments

Comments
 (0)