vue-clamp icon indicating copy to clipboard operation
vue-clamp copied to clipboard

ResizeObserver loop limit exceeded

Open gitwd1998 opened this issue 3 months ago • 0 comments

前提: autoresize: true 条件:页面缩放是会导致该异常 原因:如果在一个动画帧内,ResizeObserver不能处理所有的observations,就会触发这个ResizeObserver loop limit exceeded 解决:引入时对update节流处理

import Vue from 'vue'
import vueClamp from 'vue-clamp'

// 页面缩放响应时略显卡顿
const fixVueClampErr = (comp) => {
    const oldUpdate= table.methods.update
    comp.methods.update= function () {
        window.requestAnimationFrame(oldUpdate.bind(this))
    }
}

fixVueClampErr (vueClamp )
Vue.component('v-clamp', vueClamp)

望大公 有更好的方法进行优化

gitwd1998 avatar Apr 02 '24 08:04 gitwd1998