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

Warning if component template contains comments #904

Closed
a631807682 opened this issue Apr 1, 2020 · 2 comments
Closed

Warning if component template contains comments #904

a631807682 opened this issue Apr 1, 2020 · 2 comments

Comments

@a631807682
Copy link
Contributor

a631807682 commented Apr 1, 2020

Version

3.0.0-alpha.10

Reproduction link

https://codepen.io/a631807682/pen/KKpEexa?editors=1011

Steps to reproduce

Open the link and see the console.

What is expected?

Work like vue2.x https://codepen.io/a631807682/pen/yLNwEQb?editors=1011

What is actually happening?

Warning in console

[Vue warn]: Extraneous non-props attributes (onClick) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.

Although it's not very important to me, I have many ways to avoid it, but it looks like a bug.

@jaskang
Copy link

jaskang commented Apr 3, 2020

This is not a bug, just a warn in DEV
because when you use multiple children template, the vue will wrap a Fragment around it.

@a631807682
Copy link
Contributor Author

This is not a bug, just a warn in DEV
because when you use multiple children template, the vue will wrap a Fragment around it.

There are two nodes in the example, one is the comment and the other is the element, and I think in this case the user wants to pass attributes to the element node, rather than remove comments or wrap them.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants