Skip to content

Commit 897516f

Browse files
authored
fix: v-t custom directive warning when it will run (#2057)
1 parent 101d28e commit 897516f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ export type TranslationDirective<T = HTMLElement> = ObjectDirective<T>
9191
* @deprecated will be removed at vue-i18n v12
9292
*/
9393
export function vTDirective(i18n: I18n): TranslationDirective<HTMLElement> {
94-
if (__DEV__) {
95-
warnOnce(
96-
getWarnMessage(I18nWarnCodes.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE)
97-
)
98-
}
99-
10094
const _process = (binding: DirectiveBinding): [string, Composer] => {
95+
if (__DEV__) {
96+
warnOnce(
97+
getWarnMessage(I18nWarnCodes.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE)
98+
)
99+
}
100+
101101
const { instance, value } = binding
102102
/* istanbul ignore if */
103103
if (!instance || !instance.$) {

0 commit comments

Comments
 (0)