v-for adding empty text node at start and at end of the loop. #8705
Answered
by
so11y
thekubilay
asked this question in
Help/Questions
-
I am not very sure is it on purpose, but this is what happening here.
in the above example. when you check the log of the childNodes. you see the empty texts are added at start and at end. is it on purpose? or is it bug? |
Beta Was this translation helpful? Give feedback.
Answered by
so11y
Jul 3, 2023
Replies: 1 comment
-
This is normal. The empty nodes at the beginning and end are anchor nodes for the Fragment created by v-for directive. They are used as reference elements when inserting or modifying current child nodes. You can find the related code in this GitHub link |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
thekubilay
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is normal. The empty nodes at the beginning and end are anchor nodes for the Fragment created by v-for directive. They are used as reference elements when inserting or modifying current child nodes. You can find the related code in this GitHub link