1
- import { getCurrentInstance , nextTick } from 'vue'
1
+ import { getCurrentInstance } from 'vue'
2
2
import { createVueI18n } from '../legacy'
3
3
import { createI18nError , I18nErrorCodes } from '../errors'
4
4
import { SetPluralRulesSymbol } from '../symbols'
@@ -100,21 +100,20 @@ export function defineMixin(
100
100
} ,
101
101
102
102
mounted ( ) : void {
103
- nextTick ( ( ) => {
104
- /* istanbul ignore if */
105
- if (
106
- ( __DEV__ || __FEATURE_PROD_VUE_DEVTOOLS__ ) &&
107
- ! __NODE_JS__ &&
108
- this . $el
109
- ) {
110
- this . $el . __VUE_I18N__ = this . $i18n . __composer
111
- const emitter : VueDevToolsEmitter = ( this . __v_emitter =
112
- createEmitter < VueDevToolsEmitterEvents > ( ) )
113
- const _vueI18n = this . $i18n as unknown as VueI18nInternal
114
- _vueI18n . __enableEmitter && _vueI18n . __enableEmitter ( emitter )
115
- emitter . on ( '*' , addTimelineEvent )
116
- }
117
- } )
103
+ /* istanbul ignore if */
104
+ if (
105
+ ( __DEV__ || __FEATURE_PROD_VUE_DEVTOOLS__ ) &&
106
+ ! __NODE_JS__ &&
107
+ this . $el &&
108
+ this . $i18n
109
+ ) {
110
+ this . $el . __VUE_I18N__ = this . $i18n . __composer
111
+ const emitter : VueDevToolsEmitter = ( this . __v_emitter =
112
+ createEmitter < VueDevToolsEmitterEvents > ( ) )
113
+ const _vueI18n = this . $i18n as unknown as VueI18nInternal
114
+ _vueI18n . __enableEmitter && _vueI18n . __enableEmitter ( emitter )
115
+ emitter . on ( '*' , addTimelineEvent )
116
+ }
118
117
} ,
119
118
120
119
unmounted ( ) : void {
@@ -124,34 +123,34 @@ export function defineMixin(
124
123
throw createI18nError ( I18nErrorCodes . UNEXPECTED_ERROR )
125
124
}
126
125
127
- nextTick ( ( ) => {
128
- /* istanbul ignore if */
129
- if (
130
- ( __DEV__ || __FEATURE_PROD_VUE_DEVTOOLS__ ) &&
131
- ! __NODE_JS__ &&
132
- this . $el &&
133
- this . $el . __VUE_I18N__
134
- ) {
135
- if ( this . __v_emitter ) {
136
- this . __v_emitter . off ( '*' , addTimelineEvent )
137
- delete this . __v_emitter
138
- }
126
+ /* istanbul ignore if */
127
+ if (
128
+ ( __DEV__ || __FEATURE_PROD_VUE_DEVTOOLS__ ) &&
129
+ ! __NODE_JS__ &&
130
+ this . $el &&
131
+ this . $el . __VUE_I18N__
132
+ ) {
133
+ if ( this . __v_emitter ) {
134
+ this . __v_emitter . off ( '*' , addTimelineEvent )
135
+ delete this . __v_emitter
136
+ }
137
+ if ( this . $i18n ) {
139
138
const _vueI18n = this . $i18n as unknown as VueI18nInternal
140
139
_vueI18n . __disableEmitter && _vueI18n . __disableEmitter ( )
141
140
delete this . $el . __VUE_I18N__
142
141
}
142
+ }
143
143
144
- delete this . $t
145
- delete this . $rt
146
- delete this . $tc
147
- delete this . $te
148
- delete this . $d
149
- delete this . $n
150
- delete this . $tm
144
+ delete this . $t
145
+ delete this . $rt
146
+ delete this . $tc
147
+ delete this . $te
148
+ delete this . $d
149
+ delete this . $n
150
+ delete this . $tm
151
151
152
- i18n . __deleteInstance ( instance )
153
- delete this . $i18n
154
- } )
152
+ i18n . __deleteInstance ( instance )
153
+ delete this . $i18n
155
154
}
156
155
}
157
156
}
0 commit comments