模块 element-resize-detector
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"

posted on 2020-01-17 17:24  Charonっ  阅读(12921)  评论(0编辑  收藏  举报