This article is a mirror article of machine translation, please click here to jump to the original article.

View: 12987|Reply: 1

[Vue] Errors encountered by templates during vue usage

[Copy link]
Posted on 1/18/2018 4:06:22 PM | | | |

Error message: template syntax error Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead.
Translation result: Template syntax error The component template should contain exactly one root element, if you are using v-if multi-elements, use the v-else-if chain them.

Error reason: The vue template only supports one element and cannot contain two or more elements in parallel.
Screenshot of error code:


There are 2 controls in the code under the template /> tag< which are not supported by Vue.

Workaround: Add < div></div> to the outermost layer of the parallel control
The correct code example is shown below:







Previous:The best win10 system activation tool to use
Next:win10 KMS activation is actually a long-term activation
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com