Skip to content

Commit

Permalink
⚡ improvement(interpolation): skip non-element VNode in interpolation (
Browse files Browse the repository at this point in the history
…#211) by @myst729

* Skip non-element VNode in interpolation

* keep meaningful text content
  • Loading branch information
myst729 authored and kazupon committed Aug 25, 2017
1 parent 475dd21 commit 6be1756
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ export default {

const params: Array<any> = []
locale && params.push(locale)
children.forEach(child => params.push(child))
children.forEach(child => {
if (child.tag || child.text.trim()) {
params.push(child)
}
})

return h(props.tag, data, i18n.i(path, ...params))
}
Expand Down

0 comments on commit 6be1756

Please sign in to comment.