uni-app中radio动态生成和数据绑定

  • uni-app动态生成多个radio-group并进行数据绑定
 <uni-tr v-for="(item, index) in dataList" :key="index">
     <uni-td align="center">{{item.name}}</uni-td>
     <uni-td align="center">
         <templates slot-scope>
             <radio-group @change="(value)=>{
                item.selected = value.detail.value=='0'?false:true}">
             <radio value="0" :checked="!item.selected">合格</radio>
              <radio value="1" :checked="item.selected">不合格</radio>
            </radio-group>
          </templates>
      </uni-td>
   </uni-tr>

posted @ 2024-11-27 20:57  leepandar  阅读(3)  评论(0编辑  收藏  举报