[Vue warn]: Error compiling template: Cannot use v-for on stateful component root element because it

错误信息如下

[Vue warn]: Error compiling template: Cannot use v-for on stateful component root element because it renders multiple elements. 1 |

| ^^^^^^^^^^^^^^^^^^ 2 |
3 |
(found in ) at vue.js : 634


报错原因

在使用v-for循环遍历的时候,下面只能有一个标签,什么意思,下面有一个示例,供大家理解

错误示例


v-for="s in sites">     这个v-for循环下面有5个相同的div标签,只能有一个独一无二的标签
     

     

      {{s.post_id}}
      {{s.post_byname}}
      回帖数  {{s.answer_num}}
     

     
发布时间  {{s.post_time}}

     
    {{s.post_content}}

     

     

正确示例



v-for="s in sites">  这个v-for下面只有一个独一无二的标签