vue组件复用时,class选择器或id选择器定位dom会出现问题,需要使用ref定位到el-popover触发和弹出层的dom
参照https://www.cnblogs.com/jun-qi/p/11122196.html
<el-popover
ref="popover"
content="内容">
<el-button slot="reference">hover 激活</el-button>
</el-popover>
//获取弹出元素的dom
this.$refs.popover.$refs.popper
//获取触发元素的dom
this.$refs.popover.$refs.wrapper
详细可查看element-ui\packages\popover\src\main.vue,可见elementUI分别为内容和触发层添加了ref="popper"和ref="wrapper"