当前位置:网站首页>Use of map (the data of the list is assigned to the form, and the JSON comma separated display assignment)

Use of map (the data of the list is assigned to the form, and the JSON comma separated display assignment)

2022-07-06 19:19:00 Vegetable bird yard live

 <el-table :data="zdlxList" border style="width: 100%" max-height="250">
        <el-table-column prop="zdlb" label=" Field list ">
          <template #default="scope">
            <el-input v-model="scope.row.zdlb" type="textarea" placeholder=" Please enter the field list " />
          </template>
        </el-table-column>
        <el-table-column prop="zdsm" label=" Field description ">
          <template #default="scope">
            <el-input v-model="scope.row.zdsm" type="textarea" placeholder=" Please enter the field description " />
          </template>
        </el-table-column>
        <el-table-column prop="zdlx" label=" Field type ">
          <template #default="scope">
            <el-select v-model="scope.row.zdlx" :style="{ width: '100%' }" placeholder=" Please select ">
              <el-option
                v-for="item in zdlxTpye"
                :key="item.value"
                :label="item.label"
                :value="item.label"
              ></el-option>
            </el-select>
          </template>
        </el-table-column>
        <el-table-column label=" operation " width="100">
          <template #default="scope">
            <el-button link type="primary" size="small" @click.prevent="deleteRow(scope.$index)">
               Delete 
            </el-button>
          </template>
        </el-table-column>
      </el-table>

js part

 const aa = zdlxList.value.map(a => {
      return a.zdlx
    })
    const bb = zdlxList.value.map(a => {
      return a.zdlb
    })
    const cc = zdlxList.value.map(a => {
      return a.zdsm
    })
    data.form.fieldTypeList = aa.join(',')
    data.form.fieldList = bb.join(',')
    data.form.fieldDescList = cc.join(',')
原网站

版权声明
本文为[Vegetable bird yard live]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207061123406519.html

随机推荐