The template root requires exactly one element的解决办法 苹果函数 2022-11-10 164 阅读1分钟 vue项目中出现The template root requires exactly one element的报错,是因为vue的template模版里只能有一个根节点,所以在template模版中插入第二个元素就会报错,如图: 解决方法: 将template模版中的元素用一个大的div包起来,这样就可以在里面添加多个元素了,如图: 报错解决。