瀏覽代碼

chore: update

daiwei 9 月之前
父節點
當前提交
c272550f85
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      packages/runtime-vapor/src/insertionState.ts

+ 2 - 0
packages/runtime-vapor/src/insertionState.ts

@@ -134,6 +134,8 @@ function cacheTemplateChildren(parent: InsertionParent) {
   if (!parent.$children) {
     const nodes = parent.childNodes
     const len = nodes.length
+    if (len === 0) return
+
     const children = new Array(len) as ChildItem[]
     for (let i = 0; i < len; i++) {
       const node = nodes[i] as ChildItem