el-table多列使用el-popover
时间: 2023-10-14 07:03:26 浏览: 223
react-native-simple-popover:React Native的简单动态弹出窗口
在el-table的多列中使用el-popover可以通过在相应的el-table-column标签中设置el-popover的属性来实现。可以参考以下代码示例进行实现:
```html
<el-table>
<el-table-column label="列1">
<!-- 列1的内容 -->
</el-table-column>
<el-table-column label="列2">
<!-- 列2的内容 -->
<template slot-scope="scope">
<el-popover :ref="`popover-${scope.row.id}`" popper-class="table-list-popper" placement="left" width="200">
<!-- el-popover的内容 -->
</el-popover>
</template>
</el-table-column>
<el-table-column label="列3">
<!-- 列3的内容 -->
</el-table-column>
</el-table>
```
在以上代码中,el-popover被放置在el-table-column的template标签中,通过slot-scope获取当前行的数据,使用ref属性来标识el-popover的引用。可以根据需要设置el-popover的其他属性,比如placement设置弹出框的位置,width设置弹出框的宽度等。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [解决el-popover嵌入表格多列显示和被表格遮挡的问题](https://blog.csdn.net/Smilelifeeveryday/article/details/123247713)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *3* [解决el-table中使用el-popover组件弹窗显示关闭问题](https://blog.csdn.net/qq_41623635/article/details/131254779)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文