uniapp复选框v-for绑定数据的值

#这是错误的写法,不能把v-for写在checkbox-group上
<checkbox-group name="conditions" v-for="(item,index) in checkboxList" v-bind:key="index">
  <label>
     <checkbox :value="item" color="#FFCC33" style="transform:scale(0.7)" />{{item}}
   </label>
</checkbox-group>

 正确写法:要把v-for写在<label>里

<checkbox-group name="conditions" > 
  <labelv-for="(item,index) in checkboxList" v-bind:key="index">
     <checkbox :value="item" color="#FFCC33" style="transform:scale(0.7)" />{{item}}
   </label>
 </checkbox-group>

这个东西真的是给我搞了一晚上才搞得,颠颠的!!!

 

 

posted @ 2021-12-03 00:15  泫然  阅读(561)  评论(0)    收藏  举报