多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
[TOC] >[success] # element-ui的popover组件位置偏移 [参考文章](https://blog.csdn.net/xssxxssx/article/details/103084087) 在使用 **element-ui** 的 **popover组件** 时经常会有 **内容溢出到屏幕外** 的情況,这种情况需要重新计算内容高度,在 **接口返回数据时** 需要 **通过ref执行一次更新方法** 即可,代码如下: ~~~ <template> <el-popover ref="dcPopover" placement="top" width="1500" trigger="click"> <el-table :data="diseaseScaleData"> <el-table-column label="定量描述" prop="quantitativeDesc"/> </el-table> <i class="el-icon-question help" slot="reference"></i> </el-popover> </template> <script> export default { created(){ this.getData() }, methods:{ async getData(){ try{ // 请求接口 const res = await getDataInfo() // 重新计算 this.$nextTick(()=> { this.$refs.dcPopover.updatePopper() // 注意主要是这里 }) } catch(err){ console.warn(e) } } } } </script> ~~~