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

 

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

this.$refs.journalUpward.getBoundingClientRect().top

 

// 获取组件高度

this.$refs.top.$el.offsetHeight

// 设置元素样式

this.$refs.mask.style.top = 100 + 'px'

 

Logo

前往低代码交流专区

更多推荐