美文网首页
element 复选框多选,传给后台code和name

element 复选框多选,传给后台code和name

作者: 流泪手心_521 | 来源:发表于2020-09-23 09:41 被阅读0次

1.结构

<el-checkbox-group v-model="ruleForm.announceAppendixList">//绑定这个是传给后台的值
              <el-checkbox
                      v-for="(item,index) in announceAppList"//announceAppList是获取接口的数据
                      :key="item.targetAppCode+index"
                      :label="item"//选中的值,不用写change事件(label选中状态的值(只有在checkbox-group或者绑定对象类型为array时有效))
              >
                {{item.targetAppName}}
              </el-checkbox>
            </el-checkbox-group>

2.data的数据

ruleForm: {
                  announceAppendixList: [],//指定应用,传给后台的数组
                },
                announceAppList: [], //获取接口的数据

相关文章

网友评论

      本文标题:element 复选框多选,传给后台code和name

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