import elementResizeDetectorMaker from ‘element-resize-detector‘
const _this = this
const erd = elementResizeDetectorMaker()
erd.listenTo(document.getElementById("app"),(element)=>{
_this.$nextTick(()=>{
this.$refs.tapp.style.height= element.offsetHeight+‘px‘
})
})
给要改变高度的div添加 ref="tapp"
原文:https://www.cnblogs.com/PoisonousMushrooms/p/12206788.html