From 6be175643703b0b5ac952438b3132677f5be03c7 Mon Sep 17 00:00:00 2001 From: Leo Deng Date: Sat, 26 Aug 2017 01:21:24 +0800 Subject: [PATCH] :zap: improvement(interpolation): skip non-element VNode in interpolation (#211) by @myst729 * Skip non-element VNode in interpolation * keep meaningful text content --- src/component.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/component.js b/src/component.js index 2195c32cd..28db0dac9 100644 --- a/src/component.js +++ b/src/component.js @@ -32,7 +32,11 @@ export default { const params: Array = [] 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)) }