1.安装 element-resize-detector
npm install element-resize-detector
2.引入elementResizeDetectorMaker
import elementResizeDetectorMaker from 'element-resize-detector'
3.使用
mounted() {
this.erd = elementResizeDetectorMaker()
this.erd.listenTo(this.$refs.middle.$el, this.chartResize)
},
methods:{
chartResize(){
//do Something
}
}