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(
--- /dev/null
+<script setup lang="ts">
+import { ref } from 'vue/vapor'
+
+interface Task {
+ title: string
+ completed: boolean
+}
+const tasks = ref<Task[]>([])
+</script>
+
+<template>{{ tasks }}</template>