美文网首页
vue checkbox绑定回显二维数组

vue checkbox绑定回显二维数组

作者: 上海_前端_求内推 | 来源:发表于2022-01-04 16:22 被阅读0次

1,html

<el-form-item  :label="itemcontent.listtitle" v-if="itemcontent.type=='checkbox'" style="width:100%; display: inline-block">
                    <!-- 这里是多选 -->
                    <el-checkbox-group v-model="itemcontent.value">
                      <el-checkbox v-for="(itemlist,index3) in itemcontent.list" :key="index3" :label="itemlist.value">{{itemlist.name}}</el-checkbox>
                    </el-checkbox-group>
                  </el-form-item>

2,data

 "itemcontent": [
            {
                "listtitle": "意识",
                "list": [
                   {
                        "value": "1021",
                        "name": "面罩"
                    },
                    {
                        "value": "1022",
                        "name": "气插"
                    },
                    {
                        "value": "1023",
                        "name": "气切"
                    }
                ],
                "value": ["1021","1022"],
                "type": "checkbox"
            }
        ]

相关文章

网友评论

      本文标题:vue checkbox绑定回显二维数组

      本文链接:https://www.haomeiwen.com/subject/xnnqcrtx.html