<div>
  <div>
    <el-select class="el-select" v-model="form.label" placeholder="全部" clearable
               filterable>
      <el-option
        v-for="item in addList"
        :key="item.value"
        :label="item.label"
        :value="item.value">
      </el-option>
    </el-select>
    <span @click="add">新增</span>
  </div>
  <div v-for="(item, index) in form" :key="index">
    <el-select class="el-select" v-model="item.label" placeholder="全部" clearable
    filterable>
    <el-option
    v-for="item in addList"
    :key="item.value"
    :label="item.label"
    :value="item.value">
    </el-option>
    </el-select>
    <span class="delete" @click="deleteItem(index)">删除</span>
  </div>

</div>

export default {
  // 项目管理
  name: 'ProjectManageList',
  mixins: [pageMixin, exportModel],
  data() {
    return {
      form: [
      ],
addList: [
  {
    value: '老板',
    label: '老板'
  }, {
    value: '经理',
    label: '经理'
  }, {
    value: '主管',
    label: '主管'
  }
]
}
methods: {
add() {
  this.form.push({});
},
deleteItem(index) {
  this.form.splice(index, 1);
}
}


Logo

前往低代码交流专区

更多推荐