Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
L-Chris opened this issue May 1, 2020 · 0 comments

Comments

@L-Chris
Copy link

L-Chris commented May 1, 2020

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
  })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant