-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
An actually one root template is warned should contain exactly one root element
#4128
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
This is not a bug, @plantain-00 wrap the content within a div.
|
@anishdcruz Angular2 has one root rule too, but it doesn't ban:
reactjs can do it by other way like:
|
This blog might help https://dotdev.co/peeking-into-vue-js-2-part-1-b457e60c88c6#.tc99p056c |
#3878 issued a similar situation, and it is fixed now. |
In this case, since there is no v-else, what if all v-if conditions are false? |
The problem here is that without code analysis of all your You can get around this by either using a dynamic component (turning all conditional branches into components), or use a render function instead. |
Vue.js version
2.0.3
Reproduction Link
Steps to reproduce
What is Expected?
No warning, because it will generate at most one element.
What is actually happening?
Warning: Component template should contain exactly one root element
The text was updated successfully, but these errors were encountered: