npm install element-resize-detector --save
import elementResizeDetectorMaker from "element-resize-detector";
mounted() {
const _this = this;
const erd = elementResizeDetectorMaker();
erd.listenTo(document.getElementById("aa"), element => {
_this.$nextTick(() => {
//监听到事件后执行的业务逻辑
});
});
},
vue监听div的高度变化
最新推荐文章于 2024-08-06 17:57:29 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)