解决方案
在App.ts或者全局中添加
<script setup lang="ts">
const debounce = (fn: any, delay: any) => {
let timer: any = null;
return function () {
let context = this;
let args = arguments;
clearTimeout(timer);
timer = setTimeout(function () {
fn.apply(context, args);
}, delay);
};
};
const _ResizeObserver = window.ResizeObserver;
window.ResizeObserver = class ResizeObserver extends _ResizeObserver {
constructor(callback: any) {
callback = debounce(callback, 16);
super(callback);
}
};
</script>