daiwei vor 8 Monaten
Ursprung
Commit
c272550f85
1 geänderte Dateien mit 2 neuen und 0 gelöschten Zeilen
  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) {
   if (!parent.$children) {
     const nodes = parent.childNodes
     const nodes = parent.childNodes
     const len = nodes.length
     const len = nodes.length
+    if (len === 0) return
+
     const children = new Array(len) as ChildItem[]
     const children = new Array(len) as ChildItem[]
     for (let i = 0; i < len; i++) {
     for (let i = 0; i < len; i++) {
       const node = nodes[i] as ChildItem
       const node = nodes[i] as ChildItem