[vue/valid-template-root]The template root requires exactly one element.错误。

 出现如上图一样的错误提示,是因为Vue模版只能有一个根节点,所以需要改动一下即可。

在 <template> 中添加一个 <div>标签,之后所有的组件全部加在 <div>即可解决。

猜你喜欢

转载自blog.csdn.net/weixin_42464106/article/details/125618076