hehehai/vue-overflow-list

collapse list graw width It's stuck

hehehai opened this issue · 0 comments

const onResize = (entries: ResizeObserverEntry[]) => {
// TODO: 需要防抖
const growing = entries.some((entry) => {
const previousWidth = previousWidths.get(entry.target) || 0
return entry.contentRect.width > previousWidth
})
handleRepartition(growing)
entries.forEach(entry => previousWidths.set(entry.target, entry.contentRect.width))
}

需要设置防抖(增长默认会全部展示数据后,再依次缩小,连续变化会触发较大的计算及dom阻塞)