diff --git a/packages/compiler-vapor/src/transforms/transformInterpolation.ts b/packages/compiler-vapor/src/transforms/transformInterpolation.ts index 02b4f0208..ac1a71420 100644 --- a/packages/compiler-vapor/src/transforms/transformInterpolation.ts +++ b/packages/compiler-vapor/src/transforms/transformInterpolation.ts @@ -9,8 +9,9 @@ export const transformInterpolation: NodeTransform = (node, ctx) => { const parentChildren = ctx.parent ? ctx.parent.node.children : [] const isFirst = ctx.index === 0 const isLast = ctx.index === parentChildren.length - 1 + const isRoot = ctx.parent === ctx.root - if (isFirst && isLast) { + if (isFirst && isLast && !isRoot) { const parent = ctx.parent! const parentId = parent.reference() ctx.registerEffect( diff --git a/playground/src/dynamic.vue b/playground/src/dynamic.vue new file mode 100644 index 000000000..75bd64837 --- /dev/null +++ b/playground/src/dynamic.vue @@ -0,0 +1 @@ + diff --git a/playground/src/todo-mvc.vue b/playground/src/todo-mvc.vue new file mode 100644 index 000000000..1d9ccbd80 --- /dev/null +++ b/playground/src/todo-mvc.vue @@ -0,0 +1,11 @@ + + +