Skip to content

Commit ba3c34a

Browse files
committed
reafctor: vue-i18n built-in components
1 parent 6a93e16 commit ba3c34a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ export const Translation = /* #__PURE__*/ defineComponent({
136136
options
137137
)
138138
const assignedAttrs = assign({}, attrs)
139-
return isString(props.tag) || isObject(props.tag)
140-
? h(props.tag, assignedAttrs, children)
141-
: h(Fragment, assignedAttrs, children)
139+
const tag =
140+
isString(props.tag) || isObject(props.tag) ? props.tag : Fragment
141+
return h(tag, assignedAttrs, children)
142142
}
143143
}
144144
})

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ export function renderFormatter<
9191
}
9292

9393
const assignedAttrs = assign({}, attrs)
94-
return isString(props.tag) || isObject(props.tag)
95-
? h(props.tag, assignedAttrs, children)
96-
: h(Fragment, assignedAttrs, children)
94+
const tag =
95+
isString(props.tag) || isObject(props.tag) ? props.tag : Fragment
96+
return h(tag, assignedAttrs, children)
9797
}
9898
}

0 commit comments

Comments
 (0)