表格部分代码
el-popover绑定ref
<el-table-column
prop="cpFullName"
fixed="left"
label="名称"
:show-overflow-tooltip="true"
min-width="200"
>
<template slot-scope="scope">
<span
style="color: #409eff"
class="mouseHover"
@click="toSearch(scope.row)"
>
{{ scope.row.cpFullName }}
</span>
</template>
<template #header>
<span class="el-dropdown-link"> 名称 </span>
<el-popover
v-model="showOrHide"
placement="bottom"
width="160"
trigger="manual"
height="300"
ref="popover"
>
<div>
<div class="choice">
<el-checkbox
v-model="checkAll"
:indeterminate="isIndeterminate"
@change="handleCheckAllChange"
>
全选
</el-checkbox>
<div style="margin: 15px 0" />
<el-checkbox-group
v-model="checkedCities"
@change="handleCheckedCitiesChange"
>
<el-checkbox
v-for="(city, index) in cities"
:key="index"
:label="city.columnChName"
:disabled="
city.columnChName === '名称' ? true : false
"
>
{{ city.columnChName }}
</el-checkbox>
</el-checkbox-group>
</div>
<div class="itemsList_btn">
<el-button style="color: #1890ff" @click="confirmBtn">
确定
</el-button>
<el-button style="color: #666" @click="cancelBtn">
取消
</el-button>
</div>
</div>
<i
slot="reference"
class="el-icon-caret-bottom"
style="cursor: pointer"
@click="downBtn"
/>
</el-popover>
<!-- </el-dropdown> -->
</template>
</el-table-column>
// 表头配置框得点击
downBtn() {
this.showOrHide = true
this.$nextTick(() => {
this.$refs['popover'].$refs.popper.previousSibling.style.display = 'none'
})
}