折磨许久终于解决,百度到的答案,搬运纪念一下
<el-popover placement="bottom" title="编辑标签" width="400" trigger="manual" v-model="row.tagVisible" :ref="`popover-${row.id}`"> <div class="close-icon"> <i class="el-icon-circle-close" @click="handleTagShow(row.id)"></i> </div> <el-tag :key="tag.id" v-for="tag in row.portalDatasetsTagList" closable :disable-transitions="false" style="margin-right:8px;margin-bottom:8px;" @close="handleClose(tag)"> {{tag.tagName}} </el-tag> <el-select v-if="inputVisible" v-model="inputValue" ref="saveTagInput" filterable allow-create default-first-option placeholder="请选择标签" @change="handleInputConfirm"> <el-option v-for="item in options" :key="item.id" :label="item.tagName" :value="item.id"> </el-option> </el-select> <el-button v-else class="button-new-tag" size="small" @click="showInput" :loading="addLoading">+ 标签 </el-button> <el-button type="text" slot="reference" @click="handleTagShow(row.id)"> {{buttonLabel}} </el-button> </el-popover>
handleTagShow(id) { this.row.tagVisible = !this.row.tagVisible const key = "popover-" + id this.$nextTick(() => { document.getElementById(this.$refs[key].$refs.popper.id).style.display = "none" }) }
值得纪念这个
标签:el,column,refs,key,popover,table,id From: https://www.cnblogs.com/harryzong/p/17968304