获取dom元素的位置信息

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

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

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

前往低代码交流专区

更多推荐