fix(compiler-core): should apply text transform to <template v-for> children

This commit is contained in:
Evan You
2019-12-12 21:09:32 -05:00
parent 8ffd79c754
commit c36941c498
3 changed files with 39 additions and 2 deletions

View File

@@ -20,7 +20,11 @@ const isText = (
// Merge adjacent text nodes and expressions into a single expression
// e.g. <div>abc {{ d }} {{ e }}</div> should have a single expression node as child.
export const transformText: NodeTransform = (node, context) => {
if (node.type === NodeTypes.ROOT || node.type === NodeTypes.ELEMENT) {
if (
node.type === NodeTypes.ROOT ||
node.type === NodeTypes.ELEMENT ||
node.type === NodeTypes.FOR
) {
// perform the transform on node exit so that all expressions have already
// been processed.
return () => {