File tree Expand file tree Collapse file tree 3 files changed +15
-9
lines changed
packages/vue-i18n-core/src Expand file tree Collapse file tree 3 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ import {
51
51
SetPluralRulesSymbol ,
52
52
LegacyInstanceSymbol
53
53
} from './symbols'
54
- import { deepCopy , getLocaleMessages } from './utils'
54
+ import { deepCopy , getLocaleMessages , getComponentOptions } from './utils'
55
55
import { VERSION } from './misc'
56
56
57
57
import type { ComponentInternalInstance , VNode , VNodeArrayChildren } from 'vue'
@@ -1713,8 +1713,9 @@ function defineCoreMissingHandler(missing: MissingHandler): CoreMissingHandler {
1713
1713
// for Intlify DevTools
1714
1714
const getMetaInfo = /* #__PURE__*/ ( ) : MetaInfo | null => {
1715
1715
const instance = getCurrentInstance ( )
1716
- return instance && ( instance . type as any ) [ DEVTOOLS_META ] // eslint-disable-line @typescript-eslint/no-explicit-any
1717
- ? { [ DEVTOOLS_META ] : ( instance . type as any ) [ DEVTOOLS_META ] } // eslint-disable-line @typescript-eslint/no-explicit-any
1716
+ let meta: any = null // eslint-disable-line @typescript-eslint/no-explicit-any
1717
+ return instance && ( meta = getComponentOptions ( instance ) [ DEVTOOLS_META ] )
1718
+ ? { [ DEVTOOLS_META ] : meta } // eslint-disable-line @typescript-eslint/no-explicit-any
1718
1719
: null
1719
1720
}
1720
1721
Original file line number Diff line number Diff line change @@ -25,7 +25,11 @@ import { apply } from './plugin'
25
25
import { defineMixin as defineMixinNext } from './mixins/next'
26
26
import { defineMixin as defineMixinBridge } from './mixins/bridge'
27
27
import { enableDevTools , addTimelineEvent } from './devtools'
28
- import { isLegacyVueI18n , getLocaleMessages } from './utils'
28
+ import {
29
+ isLegacyVueI18n ,
30
+ getLocaleMessages ,
31
+ getComponentOptions
32
+ } from './utils'
29
33
30
34
import type { ComponentInternalInstance , App } from 'vue'
31
35
import type {
@@ -794,11 +798,6 @@ function getI18nInstance(instance: ComponentInternalInstance): I18n {
794
798
}
795
799
}
796
800
797
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
798
- function getComponentOptions ( instance : ComponentInternalInstance ) : any {
799
- return ! __BRIDGE__ ? instance . type : instance . proxy ! . $options
800
- }
801
-
802
801
// eslint-disable-next-line @typescript-eslint/no-explicit-any
803
802
function getScope ( options : UseI18nOptions , componentOptions : any ) : I18nScope {
804
803
// prettier-ignore
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { I18nErrorCodes, createI18nError } from './errors'
4
4
5
5
import type { Locale , MessageResolver } from '@intlify/core-base'
6
6
import type { CustomBlocks , VueMessageType } from './composer'
7
+ import type { ComponentInternalInstance } from 'vue'
7
8
8
9
type GetLocaleMessagesOptions < Messages = { } > = {
9
10
messages ?: { [ K in keyof Messages ] : Messages [ K ] }
@@ -127,4 +128,9 @@ export function deepCopy(src: any, des: any): void {
127
128
}
128
129
}
129
130
131
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
132
+ export function getComponentOptions ( instance : ComponentInternalInstance ) : any {
133
+ return ! __BRIDGE__ ? instance . type : instance . proxy ! . $options
134
+ }
135
+
130
136
/* eslint-enable @typescript-eslint/no-explicit-any */
You can’t perform that action at this time.
0 commit comments