<div ref=""jo></div>
// 常规模型
var height = this.$refs.jo.offsetHeight;
// 获取元素样式值,element 为元素ref="jo"
var heightCss = window.getComputedStyle(this.$refs.jo).height; // 100px
// 获取元素内联样式值
var heightStyle =this.$refs.jo.style.height; // 100px
this.$nextTick(() => {
console.log(this.$refs.gos.offsetHight);
})
相关阅读: