天天看点

【Vue】Component template should contain exactly one root element.

问题:

【Vue】Component template should contain exactly one root element.
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.

模板语法错误组件模板应该正好包含一个根元素,如果你使用的是v-if多元素,使用v-else-if链他们。
           

错误原因:vue模板只支持一个元素,不能并列包含两个及以上。

 解决:

【Vue】Component template should contain exactly one root element.
【Vue】Component template should contain exactly one root element.