Component template should contain exactly one root element.

在学习Vue的时候 发现了一个错误,,具体报错如:
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.

最后才知道原来vue模板只能有一个根对象

所以你想要出现正常的效果,你的用一个div来或是别的标签来包裹全部的元素

正确的写法就是:
Component template should contain exactly one root element.
在外面用个div包住