vue获取div高度

<div class="top" ref="top">

mounted () {
    
    
  let topHeight = this.$refs.top.offsetHeight // 头部高度
  console.log(topHeight)
}

猜你喜欢

转载自blog.csdn.net/yuyu_2019/article/details/112979108