vue2 resizeobserver loop completed with undelivered notifications.
时间: 2023-12-30 17:24:14 浏览: 209
根据提供的引用内容,解决"vue2 resizeobserver loop completed with undelivered notifications"错误的方法如下:
1. 使用防抖函数:
```javascript
const debounce = (fn, delay) => {
let timer = null;
return function () {
let context = this;
let args = arguments;
clearTimeout(timer);
timer = setTimeout(function () {
fn.apply(context, args);
}, delay);
}
}
```
2. 重写ResizeObserver类:
```javascript
const _ResizeObserver = window.ResizeObserver;
window.ResizeObserver = class ResizeObserver extends _ResizeObserver {
constructor(callback) {
callback = debounce(callback, 16);
super(callback);
}
}
```
3. 在需要使用ResizeObserver的地方添加show-overflow-tooltip属性:
```html
<el-table-column prop="title" label="标题" min-width="100" show-overflow-tooltip />
```
这些方法可以解决"vue2 resizeobserver loop completed with undelivered notifications"错误。
阅读全文