获取dom元素的位置信息

this.$refs['通过设置ref获取到的dom元素'].getBoundingClientRect();

//示例: 获取元素距离顶部的距离

1 this.$refs.selectLi.getBoundingClientRect().top
Logo

Vue社区为您提供最前沿的新闻资讯和知识内容

更多推荐