In what situations can a child element of a VNodeArrayChildren array be another VNodeArrayChildren array? #12488
Unanswered
kaokei
asked this question in
Help/Questions
Replies: 1 comment
-
Actually, I discovered this issue while writing test cases for my library and realizing that 100% coverage could not be achieved. Moreover, I found that the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We know that a VNode has a property called children, and its type is VNodeNormalizedChildren.
And here are the following type relationships.
The key is why it is
export type VNodeArrayChildren = Array<VNodeArrayChildren | VNodeChildAtom>;
instead ofexport type VNodeArrayChildren = Array<VNodeChildAtom>;
.I have made many attempts but haven't found a case where an element of VNodeArrayChildren is itself a VNodeArrayChildren array. It seems that VNodeArrayChildren can only be an array of VNode elements.
Can anyone provide some help?
什么场景下,VNodeArrayChildren的子元素还是VNodeArrayChildren数组呢?
我尝试了很多场景,也没有复现这个问题。
包括我发现
@vue/test-utils
这个测试工具库的测试用例中也是没有覆盖这个场景。如果不存在这个场景,是否应该修改VNodeArrayChildren的类型定义。
Beta Was this translation helpful? Give feedback.
All reactions