<div class="top" ref="top">
mounted () {
let topHeight = this.$refs.top.offsetHeight // 头部高度
console.log(topHeight)
}
vue获取div高度
最新推荐文章于 2024-07-26 15:59:09 发布
<div class="top" ref="top">
mounted () {
let topHeight = this.$refs.top.offsetHeight // 头部高度
console.log(topHeight)
}