删除循环中选中的id

del(num, item) {
      this.diseaseName.splice(num, 1);
    },
     <el-col>
            <el-form-item label="相关疾病" prop="disease">
              <el-select
                v-model="formDatanew.disease"
                value-key="id"
                placeholder="请选择相关疾病"
                @change="currentSel"
              >
                <el-option
                  v-for="item in diseaseList"
                  :key="item.id"
                  :label="item.name"
                  :value="item"
                ></el-option>
              </el-select>
              <span
                class="diseaseStyle"
                v-for="(item, index) in diseaseName"
                :key="index"
                @click="del(index,item)"
              >{{item}}X</span>
            </el-form-item>
          </el-col>
posted @ 2019-12-13 18:07  小小小小小前端  阅读(204)  评论(0编辑  收藏  举报