From 897516f1ccc633cdab60203b236d991af4b9c862 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Thu, 26 Dec 2024 16:38:28 +0900 Subject: [PATCH] fix: v-t custom directive warning when it will run (#2057) --- packages/vue-i18n-core/src/directive.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/vue-i18n-core/src/directive.ts b/packages/vue-i18n-core/src/directive.ts index 0f346f09d..bb497bdce 100644 --- a/packages/vue-i18n-core/src/directive.ts +++ b/packages/vue-i18n-core/src/directive.ts @@ -91,13 +91,13 @@ export type TranslationDirective = ObjectDirective * @deprecated will be removed at vue-i18n v12 */ export function vTDirective(i18n: I18n): TranslationDirective { - if (__DEV__) { - warnOnce( - getWarnMessage(I18nWarnCodes.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE) - ) - } - const _process = (binding: DirectiveBinding): [string, Composer] => { + if (__DEV__) { + warnOnce( + getWarnMessage(I18nWarnCodes.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE) + ) + } + const { instance, value } = binding /* istanbul ignore if */ if (!instance || !instance.$) {