Skip to content

Commit 6a7d9a4

Browse files
authored
fix: tree-shaking Fragment with for vue-i18n-bridge (#1187)
1 parent c5bcd3e commit 6a7d9a4

File tree

1 file changed

+8
-2
lines changed
  • packages/vue-i18n-core/src/components

1 file changed

+8
-2
lines changed

packages/vue-i18n-core/src/components/utils.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import { Fragment, VNode } from 'vue'
1+
import { Fragment } from 'vue'
22

33
import type { NamedValue } from '@intlify/core-base'
4+
import type { VNode } from 'vue'
5+
46
export function getInterpolateArg(
57
// eslint-disable-next-line @typescript-eslint/no-explicit-any
68
{ slots }: any, // SetupContext,
@@ -13,7 +15,11 @@ export function getInterpolateArg(
1315
return ret.reduce((slot: (VNode | typeof Fragment)[], current: any) => {
1416
return [
1517
...slot,
16-
...(current.type === Fragment ? current.children : [current])
18+
// prettier-ignore
19+
...(!__BRIDGE__
20+
? current.type === Fragment ? current.children : [current]
21+
: current.children ? current.children : [current]
22+
)
1723
]
1824
}, [])
1925
} else {

0 commit comments

Comments
 (0)