Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: tree-shaking Fragment with for vue-i18n-bridge #1187

Merged
merged 1 commit into from
Sep 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions packages/vue-i18n-core/src/components/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Fragment, VNode } from 'vue'
import { Fragment } from 'vue'

import type { NamedValue } from '@intlify/core-base'
import type { VNode } from 'vue'

export function getInterpolateArg(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
{ slots }: any, // SetupContext,
Expand All @@ -13,7 +15,11 @@ export function getInterpolateArg(
return ret.reduce((slot: (VNode | typeof Fragment)[], current: any) => {
return [
...slot,
...(current.type === Fragment ? current.children : [current])
// prettier-ignore
...(!__BRIDGE__
? current.type === Fragment ? current.children : [current]
: current.children ? current.children : [current]
)
]
}, [])
} else {
Expand Down