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

fix(nerv-server): extend the method of renderVodeToString to support void and array vnode #158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

huyang2229
Copy link

@huyang2229 huyang2229 commented Apr 5, 2020

这个 PR 做了什么? (简要描述所做更改)
使用Taro时,当用包裹多个条件表达式时,这时输出的快照不正确,原因在于Block包裹的子元素的vnode为Array类型且没有vType,而nerv-serverrenderVnodeToString没有对array类型的Vnode进行处理,具体截图如下:

image

image

打了断点,相应的输出截图如下所示:
image

为了解决上述问题,在nerv-server库中的renderVnodeToString方法中增加了对Array类型vnode的支持,此外对为覆盖到的void类型的vnode也进行了处理,避免snapshot中出现undefined字眼引起困惑。

对变动增加了单测用例,并确保提交前所有测试用例均正常通过

这个 PR 是什么类型? (至少选择一个)

  • 错误修复(Bugfix) issue id #
  • 新功能(Feature)
  • 代码重构(Refactor)
  • TypeScript 类型定义修改(Typings)
  • 文档修改(Docs)
  • 代码风格更新(Code style update)
  • 其他,请描述(Other, please describe):

这个 PR 满足以下需求:

  • 提交到 master 分支
  • Commit 信息遵循 Angular Style Commit Message Conventions
  • 所有测试用例已经通过
  • 代码遵循相关包中的 .eslintrc, .tslintrc, .stylelintrc 所规定的规范
  • 在本地测试可用,不会影响到其它功能

@coveralls
Copy link

Coverage Status

Coverage remained the same at 94.294% when pulling 96593ea on huyang2229:master into 69e5c1e on NervJS:master.

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

Successfully merging this pull request may close these issues.

None yet

2 participants