-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
remove comment dom node #1342
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
Comments
It might be expected
// https://github.com/vuejs/vue-next/blob/master/packages/runtime-core/src/vnode.ts#L491-L493
if (child == null || typeof child === 'boolean') {
// empty placeholder
return createVNode(Comment)
} else if (isArray(child)) { |
@lawvs .That scene is under |
This is intended. It doesn't affect visual output so there's no point to be "consistent" with 2.x. |
I track this with 2.x.Find some inconsistent behavior with the blew.It's has a bit of weird.
|
Too ugly, there will be many comment nodes on the DOM structure. |
Your user doesn't inspect your DOM. |
Some of them do. |
This issue is long closed now, but comment DOM nodes to affect CSS pseudo-selectors like |
here I have a case
but if the dom is empty content but threre are comment dom node by v-if, this empty css selector can not select it |
I find it rather concerning that vue gives a meaning to DOM comments. Comments can cause various issues:
|
Hi ! I asking if this comment doesn't affect DOM size when the navigator downloads the current page. In my case, on a complex page, I have more than 300 empty comments... 'Trob |
Version
3.0.0-beta.14
Reproduction link
https://jsbin.com/vucokaroxo/1/edit?html,output
Steps to reproduce
null and undefined will generate comment dom.
What is expected?
remove it
What is actually happening?
have comment dom
The text was updated successfully, but these errors were encountered: