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(() => {
        //监听到事件后执行的业务逻辑
      });
    });
  },

说明:

document.getElementById("aa")

表示,监听id为aa的div

Logo

前往低代码交流专区

更多推荐