天天看点

vue小demo实现问题解决Cannot use v-for on stateful component root element because it renders multiple elem e...

  当npm install下项目后  新建vue 参照原型写页面时 出现这个问题Cannot use v-for on stateful component root element because it renders multiple elem ents

  才发现原来 template内层进行嵌套div时  如果使用v-for循环  此div外还需要嵌套一个div 要不然渲染不了  如图:

  

vue小demo实现问题解决Cannot use v-for on stateful component root element because it renders multiple elem e...

  解决方案:

  1.在v-for的div外再嵌套一个div就ok了

转载于:https://www.cnblogs.com/PandoraS/p/11003927.html

继续阅读