首页 > 其他 > 详细

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.

时间:2021-02-23 11:12:56      阅读:34      评论:0      收藏:0      [点我收藏+]

[Vue warn]: Error compiling template:

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.

 

技术分享图片

 

先来看看引起Error模版的写法:

技术分享图片

 

引起这个错误,是模版只能有一个Root节点存在。在template内,添加一个唯一节点来包含所有内容,即可以解决:

技术分享图片

 

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.

原文:https://www.cnblogs.com/insus/p/14433955.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!