VUE获取div距离顶部的距离

762 阅读1分钟

方法一: this.$refs.contentBox.getBoundingClientRect().top 方法二: this.$refs.contentBox.offsetTop