Skip to content

diff算法里面,没考虑oldChildren为空,newChildren不为空的情况 #27

@L-Chris

Description

@L-Chris

diff.js - 64.js没有考虑oldChildren为空,newChildren不为空的情况,会导致新的children没有渲染

  _.each(oldChildren, function (child, i) {
    var newChild = newChildren[i]
    currentNodeIndex = (leftNode && leftNode.count)
      ? currentNodeIndex + leftNode.count + 1
      : currentNodeIndex + 1
    dfsWalk(child, newChild, currentNodeIndex, patches)
    leftNode = child
  })

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions