原生js监听dom元素大小变化
这里是引用
ResizeObserver avoids infinite callback loops and cyclic dependencies that are often created when resizing via a callback function. It does this by only processing elements deeper in the DOM in subsequent frames. Implementations should, if they follow the specification, invoke resize events before paint and after layout.
IE浏览器完全不支持的此api
eg:vue中使用
let element = this.$refs["ref名称"];